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

Unified Diff: build/android/pylib/perf_tests_helper.py

Issue 17390017: Allow for lists of lists when summarizing performance results (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf_tests_helper.py
diff --git a/build/android/pylib/perf_tests_helper.py b/build/android/pylib/perf_tests_helper.py
index e510eb40d64d1abe3e47472c1c84b20d3f47ef97..06335eafcd38d05888fce1b3ec5da6e087b59968 100644
--- a/build/android/pylib/perf_tests_helper.py
+++ b/build/android/pylib/perf_tests_helper.py
@@ -22,6 +22,15 @@ def _EscapePerfResult(s):
"""Escapes |s| for use in a perf result."""
return re.sub('[\:|=/#&,]', '_', s)
bulach 2013/06/19 12:19:42 nit: add another \n here and after the function (i
+def _Flatten(values):
+ """Returns a simple list without sub-lists."""
bulach 2013/06/19 12:19:42 nit: indentation should be 2 rather than 4
+ ret = []
+ for entry in values:
+ if isinstance(entry, list):
+ ret.extend(_Flatten(entry))
+ else:
+ ret.append(entry)
+ return ret
def GeomMeanAndStdDevFromHistogram(histogram_json):
histogram = json.loads(histogram_json)
@@ -99,7 +108,7 @@ def PrintPerfResult(measurement, trace, values, units, result_type='default',
assert isinstance(values, list)
assert len(values)
assert '/' not in measurement
- value, avg, sd = _MeanAndStdDevFromList(values)
+ value, avg, sd = _MeanAndStdDevFromList(_Flatten(values))
output = '%s%s: %s%s%s %s' % (
RESULT_TYPES[result_type],
_EscapePerfResult(measurement),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698