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

Side by Side Diff: tools/perf/benchmarks/indexeddb_perf.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, 6 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
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 """Runs Chromium's IndexedDB performance test. These test: 5 """Runs Chromium's IndexedDB performance test. These test:
6 6
7 Databases: 7 Databases:
8 create/delete 8 create/delete
9 Keys: 9 Keys:
10 create/delete 10 create/delete
11 Indexes: 11 Indexes:
12 create/delete 12 create/delete
13 Data access: 13 Data access:
14 Random read/write 14 Random read/write
15 Sporadic writes 15 Sporadic writes
16 Read cache 16 Read cache
17 Cursors: 17 Cursors:
18 Read & random writes 18 Read & random writes
19 Walking multiple 19 Walking multiple
20 Seeking. 20 Seeking.
21 """ 21 """
22 22
23 import json 23 import json
24 import os 24 import os
25 25
26 from metrics import memory 26 from metrics import memory
27 from metrics import power 27 from metrics import power
28 from metrics import v8_object_stats 28 from metrics import v8_object_stats
29 from telemetry import test 29 from telemetry import benchmark
30 from telemetry.core import util 30 from telemetry.core import util
31 from telemetry.page import page_measurement 31 from telemetry.page import page_measurement
32 from telemetry.page import page_set 32 from telemetry.page import page_set
33 33
34 _V8_COUNTER_NAMES = [ 34 _V8_COUNTER_NAMES = [
35 'V8.OsMemoryAllocated', 35 'V8.OsMemoryAllocated',
36 ] 36 ]
37 37
38 class _IndexedDbMeasurement(page_measurement.PageMeasurement): 38 class _IndexedDbMeasurement(page_measurement.PageMeasurement):
39 def __init__(self, *args, **kwargs): 39 def __init__(self, *args, **kwargs):
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 msec = float(result_dict[key]) 75 msec = float(result_dict[key])
76 results.Add(key, 'ms', msec, data_type='unimportant') 76 results.Add(key, 'ms', msec, data_type='unimportant')
77 total += msec 77 total += msec
78 results.Add('Total Perf', 'ms', total) 78 results.Add('Total Perf', 'ms', total)
79 79
80 def CustomizeBrowserOptions(self, options): 80 def CustomizeBrowserOptions(self, options):
81 memory.MemoryMetric.CustomizeBrowserOptions(options) 81 memory.MemoryMetric.CustomizeBrowserOptions(options)
82 power.PowerMetric.CustomizeBrowserOptions(options) 82 power.PowerMetric.CustomizeBrowserOptions(options)
83 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options) 83 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options)
84 84
85 class IndexedDb(test.Test): 85 class IndexedDb(benchmark.Benchmark):
86 """Chromium's IndexedDB Performance tests.""" 86 """Chromium's IndexedDB Performance tests."""
87 test = _IndexedDbMeasurement 87 test = _IndexedDbMeasurement
88 88
89 def CreatePageSet(self, options): 89 def CreatePageSet(self, options):
90 indexeddb_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', 90 indexeddb_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test',
91 'data', 'indexeddb') 91 'data', 'indexeddb')
92 ps = page_set.PageSet(file_path=indexeddb_dir) 92 ps = page_set.PageSet(file_path=indexeddb_dir)
93 ps.AddPageWithDefaultRunNavigate('file://perf_test.html') 93 ps.AddPageWithDefaultRunNavigate('file://perf_test.html')
94 return ps 94 return ps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698