Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1034)

Unified Diff: build/util/lib/common/perf_tests_results_helper.py

Issue 25999004: Telemetry: Check in PrintPerfResult that the flattened list is also non-zero. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/buildbot_page_measurement_results.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/buildbot_page_measurement_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698