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

Side by Side Diff: tools/perf/perf_tools/kraken.py

Issue 11348021: Automate Kraken benchmark with Chrome Remote Control. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/page_sets/kraken.json ('k') | tools/perf/perf_tools/multipage_benchmark_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 from chrome_remote_control import multi_page_benchmark
6 from chrome_remote_control import util
7
8 def _Mean(l):
9 return float(sum(l)) / len(l) if len(l) > 0 else 0.0
10
11 class Kraken(multi_page_benchmark.MultiPageBenchmark):
12 def MeasurePage(self, _, tab, results):
13 js_is_done = """
14 document.title.indexOf("Results") != -1 && document.readyState == "complete"
15 """
16 def _IsDone():
17 return bool(tab.runtime.Evaluate(js_is_done))
18 util.WaitFor(_IsDone, 300)
19
20 js_get_results = """
21 var formElement = document.getElementsByTagName("input")[0];
22 decodeURIComponent(formElement.value.split("?")[1]);
23 """
24 result_dict = eval(tab.runtime.Evaluate(js_get_results))
25 total = 0
26 for key in result_dict:
27 if key == 'v':
28 continue
29 results.Add(key, 'ms', result_dict[key])
30 total += _Mean(result_dict[key])
31 results.Add('Total', 'ms', total)
OLDNEW
« no previous file with comments | « tools/perf/page_sets/kraken.json ('k') | tools/perf/perf_tools/multipage_benchmark_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698