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

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

Issue 374943003: Update indexeddb_perf to use results.AddValue(...) (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 | « no previous file | no next file » | 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 """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
(...skipping 11 matching lines...) Expand all
22 import json 22 import json
23 import os 23 import os
24 24
25 from metrics import memory 25 from metrics import memory
26 from metrics import power 26 from metrics import power
27 from metrics import v8_object_stats 27 from metrics import v8_object_stats
28 from telemetry import benchmark 28 from telemetry import benchmark
29 from telemetry.core import util 29 from telemetry.core import util
30 from telemetry.page import page_measurement 30 from telemetry.page import page_measurement
31 from telemetry.page import page_set 31 from telemetry.page import page_set
32 from telemetry.value import scalar
32 33
33 _V8_COUNTER_NAMES = [ 34 _V8_COUNTER_NAMES = [
34 'V8.OsMemoryAllocated', 35 'V8.OsMemoryAllocated',
35 ] 36 ]
36 37
37 class _IndexedDbMeasurement(page_measurement.PageMeasurement): 38 class _IndexedDbMeasurement(page_measurement.PageMeasurement):
38 def __init__(self, *args, **kwargs): 39 def __init__(self, *args, **kwargs):
39 super(_IndexedDbMeasurement, self).__init__(*args, **kwargs) 40 super(_IndexedDbMeasurement, self).__init__(*args, **kwargs)
40 self._memory_metric = None 41 self._memory_metric = None
41 self._power_metric = None 42 self._power_metric = None
(...skipping 27 matching lines...) Expand all
69 self._power_metric.AddResults(tab, results) 70 self._power_metric.AddResults(tab, results)
70 self._v8_object_stats_metric.AddResults(tab, results) 71 self._v8_object_stats_metric.AddResults(tab, results)
71 72
72 js_get_results = "JSON.stringify(automation.getResults());" 73 js_get_results = "JSON.stringify(automation.getResults());"
73 result_dict = json.loads(tab.EvaluateJavaScript(js_get_results)) 74 result_dict = json.loads(tab.EvaluateJavaScript(js_get_results))
74 total = 0.0 75 total = 0.0
75 for key in result_dict: 76 for key in result_dict:
76 if key == 'OverallTestDuration': 77 if key == 'OverallTestDuration':
77 continue 78 continue
78 msec = float(result_dict[key]) 79 msec = float(result_dict[key])
79 results.Add(key, 'ms', msec, data_type='unimportant') 80 results.AddValue(scalar.ScalarValue(
81 results.current_page, key, 'ms', msec, important=False))
82
80 total += msec 83 total += msec
81 results.Add('Total Perf', 'ms', total) 84 results.AddValue(scalar.ScalarValue(
85 results.current_page, 'Total Perf', 'ms', total))
86
82 87
83 def CustomizeBrowserOptions(self, options): 88 def CustomizeBrowserOptions(self, options):
84 memory.MemoryMetric.CustomizeBrowserOptions(options) 89 memory.MemoryMetric.CustomizeBrowserOptions(options)
85 power.PowerMetric.CustomizeBrowserOptions(options) 90 power.PowerMetric.CustomizeBrowserOptions(options)
86 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options) 91 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options)
87 92
88 class IndexedDb(benchmark.Benchmark): 93 class IndexedDb(benchmark.Benchmark):
89 """Chromium's IndexedDB Performance tests.""" 94 """Chromium's IndexedDB Performance tests."""
90 test = _IndexedDbMeasurement 95 test = _IndexedDbMeasurement
91 96
92 def CreatePageSet(self, options): 97 def CreatePageSet(self, options):
93 indexeddb_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', 98 indexeddb_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test',
94 'data', 'indexeddb') 99 'data', 'indexeddb')
95 ps = page_set.PageSet(file_path=indexeddb_dir) 100 ps = page_set.PageSet(file_path=indexeddb_dir)
96 ps.AddPageWithDefaultRunNavigate('file://perf_test.html') 101 ps.AddPageWithDefaultRunNavigate('file://perf_test.html')
97 return ps 102 return ps
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698