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

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

Issue 11418165: Revert 169327 - Fix histogram printing for Telemetry tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
===================================================================
--- build/android/pylib/perf_tests_helper.py (revision 169505)
+++ build/android/pylib/perf_tests_helper.py (working copy)
@@ -61,7 +61,6 @@
value = ", ".join(values)
else:
value = values[0]
- avg = values[0]
return value, avg, sd
@@ -77,7 +76,9 @@
trace: A description of the particular data point, e.g. "reference".
values: A list of numeric measured values.
units: A description of the units of measure, e.g. "bytes".
- result_type: Accepts values of RESULT_TYPES.
+ result_type: A tri-state that accepts values of ['unimportant', 'default',
+ 'informational']. 'unimportant' prints RESULT, 'default' prints *RESULT
+ and 'informational' prints nothing.
print_to_stdout: If True, prints the output in stdout instead of returning
the output to caller.
@@ -86,43 +87,28 @@
"""
assert result_type in RESULT_TYPES, 'result type: %s is invalid' % result_type
- trace_name = _EscapePerfResult(trace)
-
if result_type in ['unimportant', 'default', 'informational']:
assert isinstance(values, list)
assert len(values)
assert '/' not in measurement
value, avg, sd = _MeanAndStdDevFromList(values)
- output = '%s%s: %s%s%s %s' % (
- RESULT_TYPES[result_type],
- _EscapePerfResult(measurement),
- trace_name,
- # Do not show equal sign if the trace is empty. Usually it happens when
- # measurement is enough clear to describe the result.
- '= ' if trace_name else '',
- value,
- units)
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 ])
+ value = values[0]
+ # We can't print the units, otherwise parsing the histogram json output
+ # can't be parsed easily.
+ units = ''
+ avg, sd = GeomMeanAndStdDevFromHistogram(value)
+ trace_name = _EscapePerfResult(trace)
+ output = '%s%s: %s%s%s %s' % (
+ RESULT_TYPES[result_type],
+ _EscapePerfResult(measurement),
+ trace_name,
+ # Do not show equal sign if the trace is empty. Usually it happens when
+ # measurement is enough clear to describe the result.
+ '= ' if trace_name else '',
+ value,
+ units)
if avg:
output += '\nAvg %s: %f%s' % (measurement, avg, units)
if sd:
« 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