OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 """Runs Mozilla's Kraken JavaScript benchmark.""" | 5 """Runs Mozilla's Kraken JavaScript benchmark.""" |
6 | 6 |
7 import os | 7 import os |
8 | 8 |
9 from metrics import power | 9 from metrics import power |
10 from telemetry import benchmark | 10 from telemetry import benchmark |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 var formElement = document.getElementsByTagName("input")[0]; | 92 var formElement = document.getElementsByTagName("input")[0]; |
93 decodeURIComponent(formElement.value.split("?")[1]); | 93 decodeURIComponent(formElement.value.split("?")[1]); |
94 """ | 94 """ |
95 result_dict = eval(tab.EvaluateJavaScript(js_get_results)) | 95 result_dict = eval(tab.EvaluateJavaScript(js_get_results)) |
96 total = 0 | 96 total = 0 |
97 for key in result_dict: | 97 for key in result_dict: |
98 if key == 'v': | 98 if key == 'v': |
99 continue | 99 continue |
100 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 100 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
101 results.current_page, key, 'ms', result_dict[key], important=False, | 101 results.current_page, key, 'ms', result_dict[key], important=False, |
102 description=DESCRIPTIONS.get(key))) | 102 description=DESCRIPTIONS.get(key), higher_is_better=False)) |
103 total += _Mean(result_dict[key]) | 103 total += _Mean(result_dict[key]) |
104 | 104 |
105 # TODO(tonyg/nednguyen): This measurement shouldn't calculate Total. The | 105 # TODO(tonyg/nednguyen): This measurement shouldn't calculate Total. The |
106 # results system should do that for us. | 106 # results system should do that for us. |
107 results.AddValue(scalar.ScalarValue( | 107 results.AddValue(scalar.ScalarValue( |
108 results.current_page, 'Total', 'ms', total, | 108 results.current_page, 'Total', 'ms', total, |
109 description='Total of the means of the results for each type ' | 109 description='Total of the means of the results for each type ' |
110 'of benchmark in [Mozilla\'s Kraken JavaScript benchmark]' | 110 'of benchmark in [Mozilla\'s Kraken JavaScript benchmark]' |
111 '(http://krakenbenchmark.mozilla.org/)')) | 111 '(http://krakenbenchmark.mozilla.org/)', |
| 112 higher_is_better=False)) |
112 | 113 |
113 | 114 |
114 class Kraken(benchmark.Benchmark): | 115 class Kraken(benchmark.Benchmark): |
115 """Mozilla's Kraken JavaScript benchmark.""" | 116 """Mozilla's Kraken JavaScript benchmark.""" |
116 test = _KrakenMeasurement | 117 test = _KrakenMeasurement |
117 | 118 |
118 def CreatePageSet(self, options): | 119 def CreatePageSet(self, options): |
119 ps = page_set.PageSet( | 120 ps = page_set.PageSet( |
120 archive_data_file='../page_sets/data/kraken.json', | 121 archive_data_file='../page_sets/data/kraken.json', |
121 file_path=os.path.abspath(__file__), | 122 file_path=os.path.abspath(__file__), |
122 bucket=page_set.PARTNER_BUCKET) | 123 bucket=page_set.PARTNER_BUCKET) |
123 ps.AddUserStory(page_module.Page( | 124 ps.AddUserStory(page_module.Page( |
124 'http://krakenbenchmark.mozilla.org/kraken-1.1/driver.html', | 125 'http://krakenbenchmark.mozilla.org/kraken-1.1/driver.html', |
125 ps, ps.base_dir)) | 126 ps, ps.base_dir)) |
126 return ps | 127 return ps |
OLD | NEW |