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

Unified Diff: tools/perf/perf_tools/dromaeo.py

Issue 11363232: Telemetry: adds dromaeo dom and jslib benchmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « tools/perf/page_sets/dromaeo_jslib.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/perf_tools/dromaeo.py
diff --git a/tools/perf/perf_tools/dromaeo.py b/tools/perf/perf_tools/dromaeo.py
new file mode 100644
index 0000000000000000000000000000000000000000..6ca130824a479aa4f3a675d9ee2a7bed9b8397e7
--- /dev/null
+++ b/tools/perf/perf_tools/dromaeo.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2012 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.
+
+from telemetry import multi_page_benchmark
+from telemetry import util
+
+class Dromaeo(multi_page_benchmark.MultiPageBenchmark):
+ def MeasurePage(self, page, tab, results):
+ js_is_done = 'window.document.cookie.indexOf("__done=1") >= 0'
+ def _IsDone():
+ return bool(tab.runtime.Evaluate(js_is_done))
+ util.WaitFor(_IsDone, 600, poll_interval=5)
+
+ js_get_results = 'JSON.stringify(window.automation.GetResults())'
+ print js_get_results
+ score = eval(tab.runtime.Evaluate(js_get_results))
+
+ def Escape(k):
+ chars = [' ', '-', '/', '(', ')', '*']
+ for c in chars:
+ k = k.replace(c, '_')
+ return k
+
+ suffix = page.url[page.url.index('?') + 1 : page.url.index('&')]
+ for k, v in score.iteritems():
+ data_type = 'unimportant'
+ if k == suffix:
+ data_type = 'default'
+ results.Add('score', 'runs/s', v, chart_name=Escape(k),
+ data_type=data_type)
« no previous file with comments | « tools/perf/page_sets/dromaeo_jslib.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698