1#!/usr/bin/env python 2# 3# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 4# 5# Use of this source code is governed by a BSD-style license 6# that can be found in the LICENSE file in the root of the source 7# tree. An additional intellectual property rights grant can be found 8# in the file PATENTS. All contributing project authors may 9# be found in the AUTHORS file in the root of the source tree. 10 11# Copied from /src/chrome/test/pyautolib/pyauto_utils.py in Chromium. 12 13import sys 14 15def PrintPerfResult(graph_name, series_name, data_point, units, 16 show_on_waterfall=False): 17 """Prints a line to stdout that is specially formatted for the perf bots. 18 19 Args: 20 graph_name: String name for the graph on which to plot the data. 21 series_name: String name for the series (line on the graph) associated with 22 the data. This is also the string displayed on the waterfall 23 if |show_on_waterfall| is True. 24 data_point: Numeric data value to plot on the graph for the current build. 25 This can be a single value or an array of values. If an array, 26 the graph will plot the average of the values, along with error 27 bars. 28 units: The string unit of measurement for the given |data_point|. 29 show_on_waterfall: Whether or not to display this result directly on the 30 buildbot waterfall itself (in the buildbot step running 31 this test on the waterfall page, not the stdio page). 32 """ 33 waterfall_indicator = ['', '*'][show_on_waterfall] 34 print '%sRESULT %s: %s= %s %s' % ( 35 waterfall_indicator, graph_name, series_name, 36 str(data_point).replace(' ', ''), units) 37 sys.stdout.flush() 38