Index: build/util/lib/common/perf_tests_results_helper.py |
diff --git a/build/util/lib/common/perf_tests_results_helper.py b/build/util/lib/common/perf_tests_results_helper.py |
index cec4f6950b1edbb8b2d6ff92c6a01663be00bdcc..9012f18cb45e5cc592cb88b8156dcc174c158344 100644 |
--- a/build/util/lib/common/perf_tests_results_helper.py |
+++ b/build/util/lib/common/perf_tests_results_helper.py |
@@ -25,12 +25,12 @@ def _EscapePerfResult(s): |
return re.sub('[\:|=/#&,]', '_', s) |
-def _Flatten(values): |
+def FlattenList(values): |
"""Returns a simple list without sub-lists.""" |
ret = [] |
for entry in values: |
if isinstance(entry, list): |
- ret.extend(_Flatten(entry)) |
+ ret.extend(FlattenList(entry)) |
else: |
ret.append(entry) |
return ret |
@@ -120,9 +120,10 @@ def PrintPerfResult(measurement, trace, values, units, |
result_type == perf_result_data_type.DEFAULT or |
result_type == perf_result_data_type.INFORMATIONAL): |
assert isinstance(values, list) |
- assert len(values) |
assert '/' not in measurement |
- value, avg, sd = _MeanAndStdDevFromList(_Flatten(values)) |
+ flattened_values = FlattenList(values) |
+ assert len(flattened_values) |
+ value, avg, sd = _MeanAndStdDevFromList(flattened_values) |
output = '%s%s: %s%s%s %s' % ( |
RESULT_TYPES[result_type], |
_EscapePerfResult(measurement), |