summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorvmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-15 23:28:40 +0000
committervmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-15 23:28:40 +0000
commit035e107af64549c4ad39084e36e6bd2263ee3e02 (patch)
treed8dba560bcd26210bc6cd9bf93ae607c26057e78 /tools
parent42640ee5bdccf709cd99cf9194dc57fd02873465 (diff)
downloadchromium_src-035e107af64549c4ad39084e36e6bd2263ee3e02.zip
chromium_src-035e107af64549c4ad39084e36e6bd2263ee3e02.tar.gz
chromium_src-035e107af64549c4ad39084e36e6bd2263ee3e02.tar.bz2
telemetry: Add record per area measurement.
This patch adds a record per area measurement which hooks into picture record microbenchmark. R=nduca@chromium.org NOTRY=True Review URL: https://codereview.chromium.org/27051005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/measurements/record_per_area.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/tools/perf/measurements/record_per_area.py b/tools/perf/measurements/record_per_area.py
new file mode 100644
index 0000000..c1c34c1
--- /dev/null
+++ b/tools/perf/measurements/record_per_area.py
@@ -0,0 +1,54 @@
+# Copyright 2013 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 time
+
+from metrics import smoothness
+from telemetry.core import util
+from telemetry.page import page_measurement
+
+class RecordPerArea(page_measurement.PageMeasurement):
+ def __init__(self):
+ super(RecordPerArea, self).__init__('', True)
+
+ def AddCommandLineOptions(self, parser):
+ parser.add_option('--start-wait-time', dest='start_wait_time',
+ default=2,
+ help='Wait time before the benchmark is started ' +
+ '(must be long enought to load all content)')
+
+ def CustomizeBrowserOptions(self, options):
+ smoothness.SmoothnessMetrics.CustomizeBrowserOptions(options)
+ options.AppendExtraBrowserArgs([
+ '--enable-impl-side-painting',
+ '--force-compositing-mode',
+ '--enable-threaded-compositing',
+ '--enable-gpu-benchmarking'
+ ])
+
+ def MeasurePage(self, page, tab, results):
+ # Wait until the page has loaded and come to a somewhat steady state.
+ # Needs to be adjusted for every device (~2 seconds for workstation).
+ time.sleep(float(self.options.start_wait_time))
+
+ # Enqueue benchmark
+ tab.ExecuteJavaScript("""
+ window.benchmark_results = {};
+ window.benchmark_results.done = false;
+ chrome.gpuBenchmarking.runMicroBenchmark(
+ "picture_record_benchmark",
+ function(value) {
+ window.benchmark_results.done = true;
+ window.benchmark_results.results = value;
+ });
+ """)
+
+ def _IsDone():
+ return tab.EvaluateJavaScript(
+ 'window.benchmark_results.done', timeout=120)
+ util.WaitFor(_IsDone, timeout=120)
+
+ all_data = tab.EvaluateJavaScript('window.benchmark_results.results')
+ for data in all_data:
+ results.Add('time_for_area_%07d' % (data['area']), 'ms', data['time_ms'])