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

Side by Side Diff: tools/perf/metrics/timeline.py

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 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 | « tools/perf/metrics/system_memory.py ('k') | tools/perf/metrics/timeline_unittest.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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import collections 4 import collections
5
5 from telemetry.util.statistics import DivideIfPossibleOrZero 6 from telemetry.util.statistics import DivideIfPossibleOrZero
6 7 from telemetry.value import scalar
7 from telemetry.web_perf.metrics import timeline_based_metric 8 from telemetry.web_perf.metrics import timeline_based_metric
8 from telemetry.value import scalar
9 9
10 10
11 class LoadTimesTimelineMetric(timeline_based_metric.TimelineBasedMetric): 11 class LoadTimesTimelineMetric(timeline_based_metric.TimelineBasedMetric):
12 def __init__(self): 12 def __init__(self):
13 super(LoadTimesTimelineMetric, self).__init__() 13 super(LoadTimesTimelineMetric, self).__init__()
14 self.report_main_thread_only = True 14 self.report_main_thread_only = True
15 15
16 def AddResults(self, model, renderer_thread, interaction_records, results): 16 def AddResults(self, model, renderer_thread, interaction_records, results):
17 assert model 17 assert model
18 assert len(interaction_records) == 1, ( 18 assert len(interaction_records) == 1, (
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 num_frames = frame_rate_thread.CountTracesWithName(FrameTraceName) 268 num_frames = frame_rate_thread.CountTracesWithName(FrameTraceName)
269 269
270 # Report the desired results and details. 270 # Report the desired results and details.
271 for thread_results in thread_category_results.values(): 271 for thread_results in thread_category_results.values():
272 if thread_results.name in self.results_to_report: 272 if thread_results.name in self.results_to_report:
273 thread_results.AddResults(num_frames, results) 273 thread_results.AddResults(num_frames, results)
274 # TOOD(nduca): When generic results objects are done, this special case 274 # TOOD(nduca): When generic results objects are done, this special case
275 # can be replaced with a generic UI feature. 275 # can be replaced with a generic UI feature.
276 if thread_results.name in self.details_to_report: 276 if thread_results.name in self.details_to_report:
277 thread_results.AddDetailedResults(num_frames, results) 277 thread_results.AddDetailedResults(num_frames, results)
OLDNEW
« no previous file with comments | « tools/perf/metrics/system_memory.py ('k') | tools/perf/metrics/timeline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698