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

Side by Side Diff: tools/perf/benchmarks/kraken.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/jsgamebench.py ('k') | tools/perf/benchmarks/maps.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 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 test 10 from telemetry import benchmark
11 from telemetry.page import page_measurement 11 from telemetry.page import page_measurement
12 from telemetry.page import page_set 12 from telemetry.page import page_set
13 13
14 14
15 def _Mean(l): 15 def _Mean(l):
16 return float(sum(l)) / len(l) if len(l) > 0 else 0.0 16 return float(sum(l)) / len(l) if len(l) > 0 else 0.0
17 17
18 18
19 class _KrakenMeasurement(page_measurement.PageMeasurement): 19 class _KrakenMeasurement(page_measurement.PageMeasurement):
20 def __init__(self): 20 def __init__(self):
(...skipping 21 matching lines...) Expand all
42 result_dict = eval(tab.EvaluateJavaScript(js_get_results)) 42 result_dict = eval(tab.EvaluateJavaScript(js_get_results))
43 total = 0 43 total = 0
44 for key in result_dict: 44 for key in result_dict:
45 if key == 'v': 45 if key == 'v':
46 continue 46 continue
47 results.Add(key, 'ms', result_dict[key], data_type='unimportant') 47 results.Add(key, 'ms', result_dict[key], data_type='unimportant')
48 total += _Mean(result_dict[key]) 48 total += _Mean(result_dict[key])
49 results.Add('Total', 'ms', total) 49 results.Add('Total', 'ms', total)
50 50
51 51
52 class Kraken(test.Test): 52 class Kraken(benchmark.Benchmark):
53 """Mozilla's Kraken JavaScript benchmark.""" 53 """Mozilla's Kraken JavaScript benchmark."""
54 test = _KrakenMeasurement 54 test = _KrakenMeasurement
55 55
56 def CreatePageSet(self, options): 56 def CreatePageSet(self, options):
57 ps = page_set.PageSet( 57 ps = page_set.PageSet(
58 archive_data_file='../page_sets/data/kraken.json', 58 archive_data_file='../page_sets/data/kraken.json',
59 file_path=os.path.abspath(__file__)) 59 file_path=os.path.abspath(__file__))
60 ps.AddPageWithDefaultRunNavigate( 60 ps.AddPageWithDefaultRunNavigate(
61 'http://krakenbenchmark.mozilla.org/kraken-1.1/driver.html') 61 'http://krakenbenchmark.mozilla.org/kraken-1.1/driver.html')
62 return ps 62 return ps
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/jsgamebench.py ('k') | tools/perf/benchmarks/maps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698