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

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

Issue 379563003: Convert blink_perf.py 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 import os 5 import os
6 6
7 from telemetry import benchmark 7 from telemetry import benchmark
8 from telemetry.core import util 8 from telemetry.core import util
9 from telemetry.page import page_measurement 9 from telemetry.page import page_measurement
10 from telemetry.page import page_set 10 from telemetry.page import page_set
11 from telemetry.value import list_of_scalar_values
11 12
12 13
13 def _CreatePageSetFromPath(path): 14 def _CreatePageSetFromPath(path):
14 assert os.path.exists(path) 15 assert os.path.exists(path)
15 16
16 page_urls = [] 17 page_urls = []
17 serving_dirs = set() 18 serving_dirs = set()
18 19
19 def _AddPage(path): 20 def _AddPage(path):
20 if not path.endswith('.html'): 21 if not path.endswith('.html'):
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 82
82 log = tab.EvaluateJavaScript('document.getElementById("log").innerHTML') 83 log = tab.EvaluateJavaScript('document.getElementById("log").innerHTML')
83 84
84 for line in log.splitlines(): 85 for line in log.splitlines():
85 if not line.startswith('values '): 86 if not line.startswith('values '):
86 continue 87 continue
87 parts = line.split() 88 parts = line.split()
88 values = [float(v.replace(',', '')) for v in parts[1:-1]] 89 values = [float(v.replace(',', '')) for v in parts[1:-1]]
89 units = parts[-1] 90 units = parts[-1]
90 metric = page.display_name.split('.')[0].replace('/', '_') 91 metric = page.display_name.split('.')[0].replace('/', '_')
91 results.Add(metric, units, values) 92 results.AddValue(list_of_scalar_values.ListOfScalarValues(
93 results.current_page, metric, units, values))
94
92 break 95 break
93 96
94 print log 97 print log
95 98
96 99
97 class BlinkPerfAll(benchmark.Benchmark): 100 class BlinkPerfAll(benchmark.Benchmark):
98 tag = 'all' 101 tag = 'all'
99 test = _BlinkPerfMeasurement 102 test = _BlinkPerfMeasurement
100 103
101 def CreatePageSet(self, options): 104 def CreatePageSet(self, options):
102 path = os.path.join(util.GetChromiumSrcDir(), 105 path = os.path.join(util.GetChromiumSrcDir(),
103 'third_party', 'WebKit', 'PerformanceTests') 106 'third_party', 'WebKit', 'PerformanceTests')
104 return _CreatePageSetFromPath(path) 107 return _CreatePageSetFromPath(path)
105 108
106 109
107 @benchmark.Disabled 110 @benchmark.Disabled
108 class BlinkPerfAnimation(benchmark.Benchmark): 111 class BlinkPerfAnimation(benchmark.Benchmark):
109 tag = 'animation' 112 tag = 'animation'
110 test = _BlinkPerfMeasurement 113 test = _BlinkPerfMeasurement
111 114
112 def CreatePageSet(self, options): 115 def CreatePageSet(self, options):
113 path = os.path.join(util.GetChromiumSrcDir(), 116 path = os.path.join(util.GetChromiumSrcDir(),
114 'third_party', 'WebKit', 'PerformanceTests', 'Animation') 117 'third_party', 'WebKit', 'PerformanceTests', 'Animation')
115 return _CreatePageSetFromPath(path) 118 return _CreatePageSetFromPath(path)
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