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

Side by Side Diff: tools/perf/benchmarks/dom_perf.py

Issue 387003002: Update dom_perf to use results.AddValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import math 6 import math
7 import os 7 import os
8 8
9 from telemetry import benchmark 9 from telemetry import benchmark
10 from telemetry.core import util 10 from telemetry.core import util
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 def MeasurePage(self, page, tab, results): 45 def MeasurePage(self, page, tab, results):
46 try: 46 try:
47 def _IsDone(): 47 def _IsDone():
48 return tab.GetCookieByName('__domperf_finished') == '1' 48 return tab.GetCookieByName('__domperf_finished') == '1'
49 util.WaitFor(_IsDone, 600) 49 util.WaitFor(_IsDone, 600)
50 50
51 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) 51 data = json.loads(tab.EvaluateJavaScript('__domperf_result'))
52 for suite in data['BenchmarkSuites']: 52 for suite in data['BenchmarkSuites']:
53 # Skip benchmarks that we didn't actually run this time around. 53 # Skip benchmarks that we didn't actually run this time around.
54 if len(suite['Benchmarks']) or suite['score']: 54 if len(suite['Benchmarks']) or suite['score']:
55 results.Add(SCORE_TRACE_NAME, SCORE_UNIT, 55 results.AddValue(scalar.ScalarValue(
56 suite['score'], suite['name'], 'unimportant') 56 results.current_page, '%s.%s' % (suite['name'], SCORE_TRACE_NAME),
57 SCORE_UNIT, suite['score'], important=False))
57 finally: 58 finally:
58 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') 59 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"')
59 60
60 def DidRunTest(self, browser, results): 61 def DidRunTest(self, browser, results):
61 # Now give the geometric mean as the total for the combined runs. 62 # Now give the geometric mean as the total for the combined runs.
62 combined = merge_values.MergeLikeValuesFromDifferentPages( 63 combined = merge_values.MergeLikeValuesFromDifferentPages(
63 results.all_page_specific_values, 64 results.all_page_specific_values,
64 group_by_name_suffix=True) 65 group_by_name_suffix=True)
65 combined_score = [x for x in combined if x.name == SCORE_TRACE_NAME][0] 66 combined_score = [x for x in combined if x.name == SCORE_TRACE_NAME][0]
66 total = _GeometricMean(combined_score.values) 67 total = _GeometricMean(combined_score.values)
(...skipping 23 matching lines...) Expand all
90 'Events', 91 'Events',
91 'Get+Elements', 92 'Get+Elements',
92 'GridSort', 93 'GridSort',
93 'Template' 94 'Template'
94 ] 95 ]
95 ps = page_set.PageSet(file_path=dom_perf_dir) 96 ps = page_set.PageSet(file_path=dom_perf_dir)
96 for param in run_params: 97 for param in run_params:
97 ps.AddPageWithDefaultRunNavigate( 98 ps.AddPageWithDefaultRunNavigate(
98 'file://run.html?reportInJS=1&run=%s' % param) 99 'file://run.html?reportInJS=1&run=%s' % param)
99 return ps 100 return ps
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698