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

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

Issue 337603005: Rename telemetry.test.Test to telemetry.benchmark.Benchmark. (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 | « tools/perf/benchmarks/dom_perf.py ('k') | tools/perf/benchmarks/endure.py » ('j') | 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 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 test 9 from telemetry import benchmark
10 from telemetry.page import page_measurement 10 from telemetry.page import page_measurement
11 from telemetry.page import page_set 11 from telemetry.page import page_set
12 12
13 13
14 class _DromaeoMeasurement(page_measurement.PageMeasurement): 14 class _DromaeoMeasurement(page_measurement.PageMeasurement):
15 def __init__(self): 15 def __init__(self):
16 super(_DromaeoMeasurement, self).__init__() 16 super(_DromaeoMeasurement, self).__init__()
17 self._power_metric = power.PowerMetric() 17 self._power_metric = power.PowerMetric()
18 18
19 def CustomizeBrowserOptions(self, options): 19 def CustomizeBrowserOptions(self, options):
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 escaped_top_name = data['collection'].split('-', 1)[0] 80 escaped_top_name = data['collection'].split('-', 1)[0]
81 AggregateData(aggregated, escaped_top_name, data['mean']) 81 AggregateData(aggregated, escaped_top_name, data['mean'])
82 82
83 escaped_collection = data['collection'] 83 escaped_collection = data['collection']
84 AggregateData(aggregated, escaped_collection, data['mean']) 84 AggregateData(aggregated, escaped_collection, data['mean'])
85 85
86 for key, value in aggregated.iteritems(): 86 for key, value in aggregated.iteritems():
87 AddResult(key, math.exp(value['sum'] / value['count'])) 87 AddResult(key, math.exp(value['sum'] / value['count']))
88 88
89 class _DromaeoBenchmark(test.Test): 89 class _DromaeoBenchmark(benchmark.Benchmark):
90 """A base class for Dromaeo benchmarks.""" 90 """A base class for Dromaeo benchmarks."""
91 test = _DromaeoMeasurement 91 test = _DromaeoMeasurement
92 92
93 def CreatePageSet(self, options): 93 def CreatePageSet(self, options):
94 """Makes a PageSet for Dromaeo benchmarks.""" 94 """Makes a PageSet for Dromaeo benchmarks."""
95 # Subclasses are expected to define class members called query_param and 95 # Subclasses are expected to define class members called query_param and
96 # tag. 96 # tag.
97 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): 97 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'):
98 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') 98 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.')
99 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag 99 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag
100 ps = page_set.PageSet( 100 ps = page_set.PageSet(
101 make_javascript_deterministic=False, 101 make_javascript_deterministic=False,
102 archive_data_file=archive_data_file, 102 archive_data_file=archive_data_file,
103 file_path=os.path.abspath(__file__)) 103 file_path=os.path.abspath(__file__))
104 url = 'http://dromaeo.com?%s' % self.query_param 104 url = 'http://dromaeo.com?%s' % self.query_param
105 ps.AddPageWithDefaultRunNavigate(url) 105 ps.AddPageWithDefaultRunNavigate(url)
106 return ps 106 return ps
107 107
108 108
109 class DromaeoDomCoreAttr(_DromaeoBenchmark): 109 class DromaeoDomCoreAttr(_DromaeoBenchmark):
110 """Dromaeo DOMCore attr JavaScript benchmark.""" 110 """Dromaeo DOMCore attr JavaScript benchmark."""
111 tag = 'domcoreattr' 111 tag = 'domcoreattr'
112 query_param = 'dom-attr' 112 query_param = 'dom-attr'
113 113
114 114
115 @test.Disabled('xp') # crbug.com/323782 115 @benchmark.Disabled('xp') # crbug.com/323782
116 class DromaeoDomCoreModify(_DromaeoBenchmark): 116 class DromaeoDomCoreModify(_DromaeoBenchmark):
117 """Dromaeo DOMCore modify JavaScript benchmark.""" 117 """Dromaeo DOMCore modify JavaScript benchmark."""
118 tag = 'domcoremodify' 118 tag = 'domcoremodify'
119 query_param = 'dom-modify' 119 query_param = 'dom-modify'
120 120
121 121
122 class DromaeoDomCoreQuery(_DromaeoBenchmark): 122 class DromaeoDomCoreQuery(_DromaeoBenchmark):
123 """Dromaeo DOMCore query JavaScript benchmark.""" 123 """Dromaeo DOMCore query JavaScript benchmark."""
124 tag = 'domcorequery' 124 tag = 'domcorequery'
125 query_param = 'dom-query' 125 query_param = 'dom-query'
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 """Dromaeo JSLib traverse prototype JavaScript benchmark""" 189 """Dromaeo JSLib traverse prototype JavaScript benchmark"""
190 tag = 'jslibtraverseprototype' 190 tag = 'jslibtraverseprototype'
191 query_param = 'jslib-traverse-prototype' 191 query_param = 'jslib-traverse-prototype'
192 192
193 193
194 class DromaeoCSSQueryJquery(_DromaeoBenchmark): 194 class DromaeoCSSQueryJquery(_DromaeoBenchmark):
195 """Dromaeo CSS Query jquery JavaScript benchmark""" 195 """Dromaeo CSS Query jquery JavaScript benchmark"""
196 tag = 'cssqueryjquery' 196 tag = 'cssqueryjquery'
197 query_param = 'cssquery-jquery' 197 query_param = 'cssquery-jquery'
198 198
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/dom_perf.py ('k') | tools/perf/benchmarks/endure.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698