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

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

Issue 419623002: Revert of Telemetry: Initialize smoothness and thread_times metrics before page load, not after. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | tools/perf/measurements/repaint.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 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 from measurements import timeline_controller 4 from measurements import timeline_controller
5 from metrics import loading 5 from metrics import loading
6 from metrics import timeline 6 from metrics import timeline
7 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
8 from telemetry.web_perf import timeline_interaction_record as tir_module 8 from telemetry.web_perf import timeline_interaction_record as tir_module
9 9
10 class LoadingTrace(page_measurement.PageMeasurement): 10 class LoadingTrace(page_measurement.PageMeasurement):
11 def __init__(self, *args, **kwargs): 11 def __init__(self, *args, **kwargs):
12 super(LoadingTrace, self).__init__(*args, **kwargs) 12 super(LoadingTrace, self).__init__(*args, **kwargs)
13 self._timeline_controller = timeline_controller.TimelineController() 13 self._timeline_controller = timeline_controller.TimelineController()
14 14
15 @property 15 @property
16 def results_are_the_same_on_every_page(self): 16 def results_are_the_same_on_every_page(self):
17 return False 17 return False
18 18
19 def WillNavigateToPage(self, page, tab): 19 def WillNavigateToPage(self, page, tab):
20 self._timeline_controller.SetUp(page, tab) 20 self._timeline_controller.Start(page, tab)
21 self._timeline_controller.Start(tab)
22 21
23 def MeasurePage(self, page, tab, results): 22 def MeasurePage(self, page, tab, results):
24 # In current telemetry tests, all tests wait for DocumentComplete state, 23 # In current telemetry tests, all tests wait for DocumentComplete state,
25 # but we need to wait for the load event. 24 # but we need to wait for the load event.
26 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) 25 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
27 26
28 # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to 27 # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to
29 # recognize loading as a toplevel action. 28 # recognize loading as a toplevel action.
30 self._timeline_controller.Stop(tab) 29 self._timeline_controller.Stop(tab)
31 30
32 loading.LoadingMetric().AddResults(tab, results) 31 loading.LoadingMetric().AddResults(tab, results)
33 timeline_metric = timeline.LoadTimesTimelineMetric() 32 timeline_metric = timeline.LoadTimesTimelineMetric()
34 renderer_thread = \ 33 renderer_thread = \
35 self._timeline_controller.model.GetRendererThreadFromTabId(tab.id) 34 self._timeline_controller.model.GetRendererThreadFromTabId(tab.id)
36 record = tir_module.TimelineInteractionRecord( 35 record = tir_module.TimelineInteractionRecord(
37 "loading_trace_interaction", 0, float('inf')) 36 "loading_trace_interaction", 0, float('inf'))
38 timeline_metric.AddResults( 37 timeline_metric.AddResults(
39 self._timeline_controller.model, 38 self._timeline_controller.model,
40 renderer_thread, 39 renderer_thread,
41 [record], 40 [record],
42 results) 41 results)
43 42
44 def CleanUpAfterPage(self, _, tab): 43 def CleanUpAfterPage(self, _, tab):
45 self._timeline_controller.CleanUp(tab) 44 self._timeline_controller.CleanUp(tab)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/repaint.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698