Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 import page as page_module | 10 from telemetry import page as page_module |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 def _IsDone(): | 44 def _IsDone(): |
| 45 return tab.GetCookieByName('__domperf_finished') == '1' | 45 return tab.GetCookieByName('__domperf_finished') == '1' |
| 46 util.WaitFor(_IsDone, 600) | 46 util.WaitFor(_IsDone, 600) |
| 47 | 47 |
| 48 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) | 48 data = json.loads(tab.EvaluateJavaScript('__domperf_result')) |
| 49 for suite in data['BenchmarkSuites']: | 49 for suite in data['BenchmarkSuites']: |
| 50 # Skip benchmarks that we didn't actually run this time around. | 50 # Skip benchmarks that we didn't actually run this time around. |
| 51 if len(suite['Benchmarks']) or suite['score']: | 51 if len(suite['Benchmarks']) or suite['score']: |
| 52 results.AddValue(scalar.ScalarValue( | 52 results.AddValue(scalar.ScalarValue( |
| 53 results.current_page, '%s.%s' % (suite['name'], SCORE_TRACE_NAME), | 53 results.current_page, '%s.%s' % (suite['name'], SCORE_TRACE_NAME), |
| 54 SCORE_UNIT, suite['score'], important=False)) | 54 SCORE_UNIT, suite['score'], important=False, |
| 55 higher_is_better=True)) | |
|
tonyg
2014/12/18 17:31:35
For anything that is summarizable into a numeric v
| |
| 55 finally: | 56 finally: |
| 56 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') | 57 tab.EvaluateJavaScript('document.cookie = "__domperf_finished=0"') |
| 57 | 58 |
| 58 def DidRunTest(self, browser, results): | 59 def DidRunTest(self, browser, results): |
| 59 # Now give the geometric mean as the total for the combined runs. | 60 # Now give the geometric mean as the total for the combined runs. |
| 60 combined = merge_values.MergeLikeValuesFromDifferentPages( | 61 combined = merge_values.MergeLikeValuesFromDifferentPages( |
| 61 results.all_page_specific_values, | 62 results.all_page_specific_values, |
| 62 group_by_name_suffix=True) | 63 group_by_name_suffix=True) |
| 63 combined_score = [x for x in combined if x.name == SCORE_TRACE_NAME][0] | 64 combined_score = [x for x in combined if x.name == SCORE_TRACE_NAME][0] |
| 64 total = _GeometricMean(combined_score.values) | 65 total = _GeometricMean(combined_score.values) |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 88 'Events', | 89 'Events', |
| 89 'Get+Elements', | 90 'Get+Elements', |
| 90 'GridSort', | 91 'GridSort', |
| 91 'Template' | 92 'Template' |
| 92 ] | 93 ] |
| 93 ps = page_set.PageSet(file_path=dom_perf_dir) | 94 ps = page_set.PageSet(file_path=dom_perf_dir) |
| 94 for param in run_params: | 95 for param in run_params: |
| 95 ps.AddUserStory(page_module.Page( | 96 ps.AddUserStory(page_module.Page( |
| 96 'file://run.html?reportInJS=1&run=%s' % param, ps, ps.base_dir)) | 97 'file://run.html?reportInJS=1&run=%s' % param, ps, ps.base_dir)) |
| 97 return ps | 98 return ps |
| OLD | NEW |