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

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

Issue 11573008: Telemetry: More elegant histogram printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (bulach) Created 8 years 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/multi_page_benchmark.py » ('j') | 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 68a707f8c6a42f7840e940f5c55ff496fc12c722..79ecc0448322e0de70fbf3720bd1d6f87a91d70f 100644
--- a/build/android/pylib/perf_tests_helper.py
+++ b/build/android/pylib/perf_tests_helper.py
@@ -103,23 +103,17 @@ def PrintPerfResult(measurement, trace, values, units, result_type='default',
else:
assert(result_type in ['histogram', 'unimportant-histogram'])
assert isinstance(values, list)
- assert len(values)
- # Print out each histogram separately. We can't print the units, otherwise
- # the histogram json output can't be parsed easily.
- output = ''
- ix = 1
- for value in values:
- name = '%s.%s_%d' % (_EscapePerfResult(measurement), trace_name, ix)
- output += '%s%s%s : %s = %s' % (
- '\n' if ix > 1 else '',
- RESULT_TYPES[result_type],
- name,
- name,
- value)
- ix += 1
- measurement = '%s.%s' % (measurement, trace_name)
- means_and_sds = [GeomMeanAndStdDevFromHistogram(value) for value in values]
- _, avg, sd = _MeanAndStdDevFromList([mean for (mean, _) in means_and_sds ])
+ # The histograms can only be printed individually, there's no computation
+ # across different histograms.
+ assert len(values) == 1
+ value = values[0]
+ measurement += '.' + trace_name
+ output = '%s%s: %s=%s' % (
+ RESULT_TYPES[result_type],
+ _EscapePerfResult(measurement),
+ _EscapePerfResult(measurement),
+ value)
+ avg, sd = GeomMeanAndStdDevFromHistogram(value)
if avg:
output += '\nAvg %s: %f%s' % (measurement, avg, units)
« no previous file with comments | « no previous file | tools/telemetry/telemetry/multi_page_benchmark.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698