

def ParseResults(results):
    'Result parser for UnixBench.\n\n  Sample Results:\n  1 CPUs in system; running 1 parallel copy of tests\n  8 CPUs in system; running 8 parallel copies of tests\n  Double-Precision Whetstone                    4022.0 MWIPS (9.9 s, 7 samples)\n  Execl Throughput                              4735.8 lps   (29.8 s, 2 samples)\n  File Copy 1024 bufsize 2000 maxblocks      1294367.0 KBps  (30.0 s, 2 samples)\n  File Copy 256 bufsize 500 maxblocks         396912.9 KBps  (30.0 s, 2 samples)\n  File Copy 4096 bufsize 8000 maxblocks      2513158.7 KBps  (30.0 s, 2 samples)\n  Pipe Throughput                            2221775.6 lps   (10.0 s, 7 samples)\n  Pipe-based Context Switching                369000.7 lps   (10.0 s, 7 samples)\n  Process Creation                             12587.7 lps   (30.0 s, 2 samples)\n  Shell Scripts (1 concurrent)                  8234.3 lpm   (60.0 s, 2 samples)\n  Shell Scripts (8 concurrent)                  1064.5 lpm   (60.0 s, 2 samples)\n  System Call Overhead                       4439274.5 lps   (10.0 s, 7 samples)\n\n  System Benchmarks Index Values               BASELINE       RESULT    INDEX\n  Dhrystone 2 using register variables         116700.0   34872897.7   2988.3\n  Double-Precision Whetstone                       55.0       4022.0    731.3\n  Execl Throughput                                 43.0       4735.8   1101.4\n  File Copy 1024 bufsize 2000 maxblocks          3960.0    1294367.0   3268.6\n  File Copy 256 bufsize 500 maxblocks            1655.0     396912.9   2398.3\n  File Copy 4096 bufsize 8000 maxblocks          5800.0    2513158.7   4333.0\n  Pipe Throughput                               12440.0    2221775.6   1786.0\n  Pipe-based Context Switching                   4000.0     369000.7    922.5\n  Process Creation                                126.0      12587.7    999.0\n  Shell Scripts (1 concurrent)                     42.4       8234.3   1942.1\n  Shell Scripts (8 concurrent)                      6.0       1064.5   1774.2\n  System Call Overhead                          15000.0    4439274.5   2959.5\n  ========\n  System Benchmarks Index Score                                        1825.8\n\n\n  Args:\n    results: UnixBench result.\n\n  Returns:\n    A list of sample.Sample objects.\n  '
    samples = []
    start_index = results.find(RESULT_START_STRING)
    while (start_index != (- 1)):
        next_start_index = results.find(RESULT_START_STRING, (start_index + 1))
        result = results[start_index:next_start_index]
        parallel_copies = regex_util.ExtractAllMatches(PARALLEL_COPIES_REGEX, result)
        parallel_copy_metadata = {
            'num_parallel_copies': int(parallel_copies[0]),
        }
        match = regex_util.ExtractAllMatches(RESULT_REGEX, result)
        for groups in match:
            metadata = {
                'samples': int(groups[5]),
                'time': (groups[3] + groups[4]),
            }
            metadata.update(parallel_copy_metadata)
            samples.append(sample.Sample(groups[0].strip(), float(groups[1]), groups[2], metadata))
        match = regex_util.ExtractAllMatches(SCORE_REGEX, result)
        for groups in match:
            metadata = {
                'baseline': float(groups[1]),
                'index': float(groups[3]),
            }
            metadata.update(parallel_copy_metadata)
            samples.append(sample.Sample(('%s:score' % groups[0].strip()), value=float(groups[2]), unit='', metadata=metadata))
        match = regex_util.ExtractAllMatches(SYSTEM_SCORE_REGEX, result)
        samples.append(sample.Sample('System Benchmarks Index Score', float(match[0]), unit='', metadata=parallel_copy_metadata))
        start_index = next_start_index
    return samples

dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py ParseResults/original