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

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

Issue 58423002: [Telemetry] Print trace counters with trace events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit Created 7 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 | Annotate | Revision Log
« 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 import collections 4 import collections
5 5
6 from metrics import Metric 6 from metrics import Metric
7 from telemetry.page import page_measurement 7 from telemetry.page import page_measurement
8 8
9 TRACING_MODE = 'tracing-mode' 9 TRACING_MODE = 'tracing-mode'
10 TIMELINE_MODE = 'timeline-mode' 10 TIMELINE_MODE = 'timeline-mode'
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 for e in events: 66 for e in events:
67 events_by_name[e.name].append(e) 67 events_by_name[e.name].append(e)
68 68
69 for event_name, event_group in events_by_name.iteritems(): 69 for event_name, event_group in events_by_name.iteritems():
70 times = [event.self_time for event in event_group] 70 times = [event.self_time for event in event_group]
71 total = sum(times) 71 total = sum(times)
72 biggest_jank = max(times) 72 biggest_jank = max(times)
73 results.Add(event_name, 'ms', total) 73 results.Add(event_name, 'ms', total)
74 results.Add(event_name + '_max', 'ms', biggest_jank) 74 results.Add(event_name + '_max', 'ms', biggest_jank)
75 results.Add(event_name + '_avg', 'ms', total / len(times)) 75 results.Add(event_name + '_avg', 'ms', total / len(times))
76
77 counters_by_name = self._thread_for_tab.parent.counters
78 for counter_name, counter in counters_by_name.iteritems():
79 total = sum(counter.totals)
80 results.Add(counter_name, 'count', total)
81 results.Add(counter_name + '_avg', 'count', total / len(counter.totals))
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