| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import math | 10 import math |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 '= ' if trace_name else '', | 127 '= ' if trace_name else '', |
| 128 value, | 128 value, |
| 129 units) | 129 units) |
| 130 else: | 130 else: |
| 131 assert perf_result_data_type.IsHistogram(result_type) | 131 assert perf_result_data_type.IsHistogram(result_type) |
| 132 assert isinstance(values, list) | 132 assert isinstance(values, list) |
| 133 # The histograms can only be printed individually, there's no computation | 133 # The histograms can only be printed individually, there's no computation |
| 134 # across different histograms. | 134 # across different histograms. |
| 135 assert len(values) == 1 | 135 assert len(values) == 1 |
| 136 value = values[0] | 136 value = values[0] |
| 137 output = '%s%s: %s= %s' % ( | 137 output = '%s%s: %s= %s %s' % ( |
| 138 RESULT_TYPES[result_type], | 138 RESULT_TYPES[result_type], |
| 139 _EscapePerfResult(measurement), | 139 _EscapePerfResult(measurement), |
| 140 trace_name, | 140 trace_name, |
| 141 value) | 141 value, |
| 142 units) |
| 142 avg, sd = GeomMeanAndStdDevFromHistogram(value) | 143 avg, sd = GeomMeanAndStdDevFromHistogram(value) |
| 143 | 144 |
| 144 if avg: | 145 if avg: |
| 145 output += '\nAvg %s: %f%s' % (measurement, avg, units) | 146 output += '\nAvg %s: %f%s' % (measurement, avg, units) |
| 146 if sd: | 147 if sd: |
| 147 output += '\nSd %s: %f%s' % (measurement, sd, units) | 148 output += '\nSd %s: %f%s' % (measurement, sd, units) |
| 148 if print_to_stdout: | 149 if print_to_stdout: |
| 149 print output | 150 print output |
| 150 sys.stdout.flush() | 151 sys.stdout.flush() |
| 151 return output | 152 return output |
| OLD | NEW |