| 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 math | 5 import math |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from metrics import power | 8 from metrics import power |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 container[key] = {'count': 0, 'sum': 0} | 70 container[key] = {'count': 0, 'sum': 0} |
| 71 container[key]['count'] += 1 | 71 container[key]['count'] += 1 |
| 72 container[key]['sum'] += math.log(value) | 72 container[key]['sum'] += math.log(value) |
| 73 | 73 |
| 74 suffix = page.url[page.url.index('?') + 1 :] | 74 suffix = page.url[page.url.index('?') + 1 :] |
| 75 def AddResult(name, value): | 75 def AddResult(name, value): |
| 76 important = False | 76 important = False |
| 77 if name == suffix: | 77 if name == suffix: |
| 78 important = True | 78 important = True |
| 79 results.AddValue(scalar.ScalarValue( | 79 results.AddValue(scalar.ScalarValue( |
| 80 results.current_page, Escape(name), 'runs/s', value, important)) | 80 results.current_page, Escape(name), 'runs/s', value, important, |
| 81 higher_is_better=True)) |
| 81 | 82 |
| 82 aggregated = {} | 83 aggregated = {} |
| 83 for data in score: | 84 for data in score: |
| 84 AddResult('%s/%s' % (data['collection'], data['name']), | 85 AddResult('%s/%s' % (data['collection'], data['name']), |
| 85 data['mean']) | 86 data['mean']) |
| 86 | 87 |
| 87 top_name = data['collection'].split('-', 1)[0] | 88 top_name = data['collection'].split('-', 1)[0] |
| 88 AggregateData(aggregated, top_name, data['mean']) | 89 AggregateData(aggregated, top_name, data['mean']) |
| 89 | 90 |
| 90 collection_name = data['collection'] | 91 collection_name = data['collection'] |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 """Dromaeo JSLib traverse prototype JavaScript benchmark""" | 197 """Dromaeo JSLib traverse prototype JavaScript benchmark""" |
| 197 tag = 'jslibtraverseprototype' | 198 tag = 'jslibtraverseprototype' |
| 198 query_param = 'jslib-traverse-prototype' | 199 query_param = 'jslib-traverse-prototype' |
| 199 | 200 |
| 200 | 201 |
| 201 class DromaeoCSSQueryJquery(_DromaeoBenchmark): | 202 class DromaeoCSSQueryJquery(_DromaeoBenchmark): |
| 202 """Dromaeo CSS Query jquery JavaScript benchmark""" | 203 """Dromaeo CSS Query jquery JavaScript benchmark""" |
| 203 tag = 'cssqueryjquery' | 204 tag = 'cssqueryjquery' |
| 204 query_param = 'cssquery-jquery' | 205 query_param = 'cssquery-jquery' |
| 205 | 206 |
| OLD | NEW |