

def CollectResults(benchmark_spec, metadata):
    'Collect and parse test results.\n\n  Args:\n    benchmark_spec: The benchmark specification. Contains all data\n        that is required to run the benchmark.\n    metadata: dict. Contains metadata for this benchmark.\n\n  Returns:\n    A list of sample.Sample objects.\n  '
    logging.info('Gathering results.')
    vm_dict = benchmark_spec.vm_groups
    loader_vms = vm_dict[CLIENT_GROUP]
    raw_results = collections.defaultdict(list)
    args = [((vm, raw_results), {
        
    }) for vm in loader_vms]
    vm_util.RunThreaded(CollectResultFile, args)
    results = []
    for metric in RESULTS_METRICS:
        if (metric in MAXIMUM_METRICS):
            value = max(raw_results[metric])
        else:
            value = math.fsum(raw_results[metric])
            if (metric not in AGGREGATED_METRICS):
                value = (value / len(loader_vms))
        if metric.startswith('latency'):
            unit = 'ms'
        elif metric.endswith('rate'):
            unit = 'operations per second'
        elif (metric == 'Total operation time'):
            unit = 'seconds'
        results.append(sample.Sample(metric, value, unit, metadata))
    logging.info('Cassandra results:\n%s', args)
    return results

dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cassandra_stress_benchmark.py CollectResults/VarMisuse@213/390 `results`->`args`