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

Side by Side Diff: build/android/pylib/perf_tests_helper.py

Issue 23470006: Output units with histogram results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update unit tests Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 import sys 6 import sys
7 7
8 import android_commands 8 import android_commands
9 import json 9 import json
10 import logging 10 import logging
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 '= ' if trace_name else '', 121 '= ' if trace_name else '',
122 value, 122 value,
123 units) 123 units)
124 else: 124 else:
125 assert(result_type in ['histogram', 'unimportant-histogram']) 125 assert(result_type in ['histogram', 'unimportant-histogram'])
126 assert isinstance(values, list) 126 assert isinstance(values, list)
127 # The histograms can only be printed individually, there's no computation 127 # The histograms can only be printed individually, there's no computation
128 # across different histograms. 128 # across different histograms.
129 assert len(values) == 1 129 assert len(values) == 1
130 value = values[0] 130 value = values[0]
131 output = '%s%s: %s= %s' % ( 131 output = '%s%s: %s= %s %s' % (
132 RESULT_TYPES[result_type], 132 RESULT_TYPES[result_type],
133 _EscapePerfResult(measurement), 133 _EscapePerfResult(measurement),
134 trace_name, 134 trace_name,
135 value) 135 value,
136 units)
136 avg, sd = GeomMeanAndStdDevFromHistogram(value) 137 avg, sd = GeomMeanAndStdDevFromHistogram(value)
137 138
138 if avg: 139 if avg:
139 output += '\nAvg %s: %f%s' % (measurement, avg, units) 140 output += '\nAvg %s: %f%s' % (measurement, avg, units)
140 if sd: 141 if sd:
141 output += '\nSd %s: %f%s' % (measurement, sd, units) 142 output += '\nSd %s: %f%s' % (measurement, sd, units)
142 if print_to_stdout: 143 if print_to_stdout:
143 print output 144 print output
144 sys.stdout.flush() 145 sys.stdout.flush()
145 return output 146 return output
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 """Resets the original performance mode of the device.""" 194 """Resets the original performance mode of the device."""
194 self._SetScalingGovernorInternal(self._original_scaling_governor) 195 self._SetScalingGovernorInternal(self._original_scaling_governor)
195 196
196 def _SetScalingGovernorInternal(self, value): 197 def _SetScalingGovernorInternal(self, value):
197 for cpu in range(self._kernel_max + 1): 198 for cpu in range(self._kernel_max + 1):
198 scaling_governor_file = PerfControl._SCALING_GOVERNOR_FMT % cpu 199 scaling_governor_file = PerfControl._SCALING_GOVERNOR_FMT % cpu
199 if self._adb.FileExistsOnDevice(scaling_governor_file): 200 if self._adb.FileExistsOnDevice(scaling_governor_file):
200 logging.info('Writing scaling governor mode \'%s\' -> %s' % 201 logging.info('Writing scaling governor mode \'%s\' -> %s' %
201 (value, scaling_governor_file)) 202 (value, scaling_governor_file))
202 self._adb.SetProtectedFileContents(scaling_governor_file, value) 203 self._adb.SetProtectedFileContents(scaling_governor_file, value)
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/page/buildbot_page_measurement_results_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698