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

Side by Side Diff: tools/perf/measurements/blink_style.py

Issue 2452333004: [Telemetry] Fix exception handling for blink_styles and rasterize_and_record use of WaitFor (Closed)
Patch Set: Add rasterize_and_record_micro Created 4 years, 1 month 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 | tools/perf/measurements/rasterize_and_record_micro.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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 from collections import defaultdict 5 from collections import defaultdict
6 from itertools import starmap 6 from itertools import starmap
7 from telemetry.core import exceptions
8 from telemetry.core import util 7 from telemetry.core import util
9 from telemetry.page import legacy_page_test 8 from telemetry.page import legacy_page_test
10 from telemetry.value import scalar 9 from telemetry.value import scalar
11 10
12 from measurements import timeline_controller 11 from measurements import timeline_controller
12 import py_utils
13 13
14 14
15 class BlinkStyle(legacy_page_test.LegacyPageTest): 15 class BlinkStyle(legacy_page_test.LegacyPageTest):
16 16
17 def __init__(self): 17 def __init__(self):
18 super(BlinkStyle, self).__init__() 18 super(BlinkStyle, self).__init__()
19 self._controller = None 19 self._controller = None
20 20
21 def WillNavigateToPage(self, page, tab): 21 def WillNavigateToPage(self, page, tab):
22 self._controller = timeline_controller.TimelineController() 22 self._controller = timeline_controller.TimelineController()
23 self._controller.trace_categories = 'blink_style,blink.console' 23 self._controller.trace_categories = 'blink_style,blink.console'
24 self._controller.SetUp(page, tab) 24 self._controller.SetUp(page, tab)
25 self._controller.Start(tab) 25 self._controller.Start(tab)
26 26
27 def DidRunPage(self, platform): 27 def DidRunPage(self, platform):
28 if self._controller: 28 if self._controller:
29 self._controller.CleanUp(platform) 29 self._controller.CleanUp(platform)
30 30
31 def ValidateAndMeasurePage(self, page, tab, results): 31 def ValidateAndMeasurePage(self, page, tab, results):
32 with tab.action_runner.CreateInteraction('wait-for-quiescence'): 32 with tab.action_runner.CreateInteraction('wait-for-quiescence'):
33 tab.ExecuteJavaScript('console.time("");') 33 tab.ExecuteJavaScript('console.time("");')
34 try: 34 try:
35 util.WaitFor(tab.HasReachedQuiescence, 15) 35 util.WaitFor(tab.HasReachedQuiescence, 15)
36 except exceptions.TimeoutException: 36 except py_utils.TimeoutException:
37 # Some sites never reach quiesence. As this benchmark normalizes/ 37 # Some sites never reach quiesence. As this benchmark normalizes/
38 # categories results, it shouldn't be necessary to reach the same 38 # categories results, it shouldn't be necessary to reach the same
39 # state on every run. 39 # state on every run.
40 pass 40 pass
41 41
42 tab.ExecuteJavaScript(''' 42 tab.ExecuteJavaScript('''
43 for (var i = 0; i < 11; i++) { 43 for (var i = 0; i < 11; i++) {
44 var cold = i % 2 == 0; 44 var cold = i % 2 == 0;
45 var name = "update_style"; 45 var name = "update_style";
46 if (cold) name += "_cold"; 46 if (cold) name += "_cold";
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 tokens = sum(event.tokens for event in events) 135 tokens = sum(event.tokens for event in events)
136 length = sum(event.length for event in events) 136 length = sum(event.length for event in events)
137 137
138 results.AddValue( 138 results.AddValue(
139 scalar.ScalarValue(page, ('parse_css_%s' % category), 139 scalar.ScalarValue(page, ('parse_css_%s' % category),
140 'tokens/s', 1000 / (parse_duration / tokens))) 140 'tokens/s', 1000 / (parse_duration / tokens)))
141 141
142 results.AddValue( 142 results.AddValue(
143 scalar.ScalarValue(page, ('tokenize_css_%s' % category), 143 scalar.ScalarValue(page, ('tokenize_css_%s' % category),
144 'char/s', 1000 / (tokenize_duration / length))) 144 'char/s', 1000 / (tokenize_duration / length)))
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/rasterize_and_record_micro.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698