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

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

Issue 11340037: Chrome remote control multi-page tests: Enable printing out histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
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 c0a3ee413d80d5ed924538d1ddab86b377ea4016..485240c1f2789942f7521d39c9ccdd8201d0d453 100644
--- a/build/android/pylib/perf_tests_helper.py
+++ b/build/android/pylib/perf_tests_helper.py
@@ -10,7 +10,9 @@ import math
# Valid values of result type.
RESULT_TYPES = {'unimportant': 'RESULT ',
'default': '*RESULT ',
- 'informational': ''}
+ 'informational': '',
+ 'unimportant-histogram': 'HISTOGRAM ',
+ 'histogram': '*HISTOGRAM '}
def _EscapePerfResult(s):
@@ -43,22 +45,28 @@ def PrintPerfResult(measurement, trace, values, units, result_type='default',
"""
assert result_type in RESULT_TYPES, 'result type: %s is invalid' % result_type
- assert isinstance(values, list)
- assert len(values)
- assert '/' not in measurement
- avg = None
- sd = None
- if len(values) > 1:
- try:
- value = '[%s]' % ','.join([str(v) for v in values])
- avg = sum([float(v) for v in values]) / len(values)
- sqdiffs = [(float(v) - avg) ** 2 for v in values]
- variance = sum(sqdiffs) / (len(values) - 1)
- sd = math.sqrt(variance)
- except ValueError:
- value = ", ".join(values)
+ if (result_type == 'unimportant' or result_type == 'default' or
+ result_type == 'informational'):
tonyg 2012/10/30 15:52:59 if result_type in ['unimportant', 'default', 'info
marja 2012/10/30 17:19:01 Done.
+ assert isinstance(values, list)
+ assert len(values)
+ assert '/' not in measurement
+ avg = None
+ sd = None
+ if len(values) > 1:
+ try:
+ value = '[%s]' % ','.join([str(v) for v in values])
+ avg = sum([float(v) for v in values]) / len(values)
+ sqdiffs = [(float(v) - avg) ** 2 for v in values]
+ variance = sum(sqdiffs) / (len(values) - 1)
+ sd = math.sqrt(variance)
+ except ValueError:
+ value = ", ".join(values)
+ else:
+ value = values[0]
else:
- value = values[0]
+ value = values
+ avg = None
tonyg 2012/10/30 15:52:59 Is it too much code to go ahead and calculate the
marja 2012/10/30 17:19:01 Duplicated the code from the page cycler log parse
+ sd = None
trace_name = _EscapePerfResult(trace)
output = '%s%s: %s%s%s %s' % (

Powered by Google App Engine
This is Rietveld 408576698