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

Unified Diff: build/android/perf_tests_helper.py

Issue 10693110: [android] Split top-level scripts and libraries from build/android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright on __init__.py, removed #! on some pylib/ files. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/flag_changer.py ('k') | build/android/pylib/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/perf_tests_helper.py
diff --git a/build/android/perf_tests_helper.py b/build/android/perf_tests_helper.py
deleted file mode 100644
index 740c455ddbe3867a317d3a16d47a12da19fa01f5..0000000000000000000000000000000000000000
--- a/build/android/perf_tests_helper.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import re
-
-
-def _EscapePerfResult(s):
- """Escapes |s| for use in a perf result."""
- # Colons (:) and equal signs (=) are not allowed, and we chose an arbitrary
- # limit of 40 chars.
- return re.sub(':|=', '_', s[:40])
-
-
-def PrintPerfResult(measurement, trace, values, units, important=True,
- print_to_stdout=True):
- """Prints numerical data to stdout in the format required by perf tests.
-
- The string args may be empty but they must not contain any colons (:) or
- equals signs (=).
-
- Args:
- measurement: A description of the quantity being measured, e.g. "vm_peak".
- trace: A description of the particular data point, e.g. "reference".
- values: A list of numeric measured values.
- units: A description of the units of measure, e.g. "bytes".
- important: If True, the output line will be specially marked, to notify the
- post-processor.
-
- Returns:
- String of the formated perf result.
- """
- important_marker = '*' if important else ''
-
- assert isinstance(values, list)
- assert len(values)
- assert '/' not in measurement
- avg = None
- if len(values) > 1:
- try:
- value = '[%s]' % ','.join([str(v) for v in values])
- avg = sum([float(v) for v in values]) / len(values)
- except ValueError:
- value = ", ".join(values)
- else:
- value = values[0]
-
- output = '%sRESULT %s: %s= %s %s' % (important_marker,
- _EscapePerfResult(measurement),
- _EscapePerfResult(trace),
- value, units)
- if avg:
- output += '\nAvg %s: %d%s' % (measurement, avg, units)
- if print_to_stdout:
- print output
- return output
« no previous file with comments | « build/android/flag_changer.py ('k') | build/android/pylib/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698