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

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

Issue 199733007: Remove start & stop logic from timeline_metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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/thread_times.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 metrics import loading 5 from metrics import loading
5 from metrics import timeline 6 from metrics import timeline
6 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
7 8
8 class LoadingTrace(page_measurement.PageMeasurement): 9 class LoadingTrace(page_measurement.PageMeasurement):
9 def __init__(self, *args, **kwargs): 10 def __init__(self, *args, **kwargs):
10 super(LoadingTrace, self).__init__(*args, **kwargs) 11 super(LoadingTrace, self).__init__(*args, **kwargs)
11 self._timeline_metric = timeline.LoadTimesTimelineMetric() 12 self._timeline_controller = timeline_controller.TimelineController()
12 13
13 @property 14 @property
14 def results_are_the_same_on_every_page(self): 15 def results_are_the_same_on_every_page(self):
15 return False 16 return False
16 17
17 def WillNavigateToPage(self, page, tab): 18 def WillNavigateToPage(self, page, tab):
18 self._timeline_metric.Start(page, tab) 19 self._timeline_controller.Start(page, tab)
19 20
20 def MeasurePage(self, page, tab, results): 21 def MeasurePage(self, page, tab, results):
21 # In current telemetry tests, all tests wait for DocumentComplete state, 22 # In current telemetry tests, all tests wait for DocumentComplete state,
22 # but we need to wait for the load event. 23 # but we need to wait for the load event.
23 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300) 24 tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
24 25
25 # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to 26 # TODO(nduca): when crbug.com/168431 is fixed, modify the page sets to
26 # recognize loading as a toplevel action. 27 # recognize loading as a toplevel action.
27 self._timeline_metric.Stop(page, tab) 28 self._timeline_controller.Stop(tab)
28 29
29 loading.LoadingMetric().AddResults(tab, results) 30 loading.LoadingMetric().AddResults(tab, results)
30 self._timeline_metric.AddResults(tab, results) 31 timeline_metric = timeline.TimelineMetric(
32 self._timeline_controller.model,
33 self._timeline_controller.renderer_process,
34 self._timeline_controller.action_ranges)
35 timeline_metric.AddResults(tab, results)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/measurements/thread_times.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698