Chromium Code Reviews| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 print 'Pages: [%s]' % ','.join([_EscapePerfResult(p) for p in page_list]) | 85 print 'Pages: [%s]' % ','.join([_EscapePerfResult(p) for p in page_list]) |
| 86 | 86 |
| 87 | 87 |
| 88 def PrintPerfResult(measurement, trace, values, units, | 88 def PrintPerfResult(measurement, trace, values, units, |
| 89 result_type=perf_result_data_type.DEFAULT, | 89 result_type=perf_result_data_type.DEFAULT, |
| 90 print_to_stdout=True): | 90 print_to_stdout=True): |
| 91 """Prints numerical data to stdout in the format required by perf tests. | 91 """Prints numerical data to stdout in the format required by perf tests. |
| 92 | 92 |
| 93 The string args may be empty but they must not contain any colons (:) or | 93 The string args may be empty but they must not contain any colons (:) or |
| 94 equals signs (=). | 94 equals signs (=). |
| 95 This is parsed by the buildbot using: | |
| 96 http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/process_ log_utils.py?view=log | |
|
Dominik Grewe
2013/10/02 14:11:59
Do you want to link to the log of the file or the
bulach
2013/10/02 16:50:04
ahn, yeah, the file itself :)
done, thanks!
| |
| 95 | 97 |
| 96 Args: | 98 Args: |
| 97 measurement: A description of the quantity being measured, e.g. "vm_peak". | 99 measurement: A description of the quantity being measured, e.g. "vm_peak". |
| 100 On the dashboard, this maps to a particular graph. Mandatory. | |
| 98 trace: A description of the particular data point, e.g. "reference". | 101 trace: A description of the particular data point, e.g. "reference". |
| 102 On the dashboard, this maps to a particular "line" in the graph. | |
| 103 Mandatory. | |
| 99 values: A list of numeric measured values. An N-dimensional list will be | 104 values: A list of numeric measured values. An N-dimensional list will be |
| 100 flattened and treated as a simple list. | 105 flattened and treated as a simple list. |
| 101 units: A description of the units of measure, e.g. "bytes". | 106 units: A description of the units of measure, e.g. "bytes". |
| 102 result_type: Accepts values of perf_result_data_type.ALL_TYPES. | 107 result_type: Accepts values of perf_result_data_type.ALL_TYPES. |
| 103 print_to_stdout: If True, prints the output in stdout instead of returning | 108 print_to_stdout: If True, prints the output in stdout instead of returning |
| 104 the output to caller. | 109 the output to caller. |
| 105 | 110 |
| 106 Returns: | 111 Returns: |
| 107 String of the formated perf result. | 112 String of the formated perf result. |
| 108 """ | 113 """ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 avg, sd = GeomMeanAndStdDevFromHistogram(value) | 148 avg, sd = GeomMeanAndStdDevFromHistogram(value) |
| 144 | 149 |
| 145 if avg: | 150 if avg: |
| 146 output += '\nAvg %s: %f%s' % (measurement, avg, units) | 151 output += '\nAvg %s: %f%s' % (measurement, avg, units) |
| 147 if sd: | 152 if sd: |
| 148 output += '\nSd %s: %f%s' % (measurement, sd, units) | 153 output += '\nSd %s: %f%s' % (measurement, sd, units) |
| 149 if print_to_stdout: | 154 if print_to_stdout: |
| 150 print output | 155 print output |
| 151 sys.stdout.flush() | 156 sys.stdout.flush() |
| 152 return output | 157 return output |
| OLD | NEW |