phoglund@webrtc.org | 3bb42ef | 2012-12-10 10:08:00 | [diff] [blame] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | # Copied from /src/chrome/test/pyautolib/pyauto_utils.py in Chromium. |
| 6 | |
| 7 | import sys |
| 8 | |
| 9 | def PrintPerfResult(graph_name, series_name, data_point, units, |
| 10 | show_on_waterfall=False): |
| 11 | """Prints a line to stdout that is specially formatted for the perf bots. |
| 12 | |
| 13 | Args: |
| 14 | graph_name: String name for the graph on which to plot the data. |
| 15 | series_name: String name for the series (line on the graph) associated with |
| 16 | the data. This is also the string displayed on the waterfall |
| 17 | if |show_on_waterfall| is True. |
| 18 | data_point: Numeric data value to plot on the graph for the current build. |
| 19 | This can be a single value or an array of values. If an array, |
| 20 | the graph will plot the average of the values, along with error |
| 21 | bars. |
| 22 | units: The string unit of measurement for the given |data_point|. |
| 23 | show_on_waterfall: Whether or not to display this result directly on the |
| 24 | buildbot waterfall itself (in the buildbot step running |
| 25 | this test on the waterfall page, not the stdio page). |
| 26 | """ |
| 27 | waterfall_indicator = ['', '*'][show_on_waterfall] |
| 28 | print '%sRESULT %s: %s= %s %s' % ( |
| 29 | waterfall_indicator, graph_name, series_name, |
| 30 | str(data_point).replace(' ', ''), units) |
| 31 | sys.stdout.flush() |