OLD | NEW |
---|---|
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 |
6 from telemetry.util.statistics import DivideIfPossibleOrZero | 6 from telemetry.util.statistics import DivideIfPossibleOrZero |
7 from telemetry.value import scalar | 7 from telemetry.value import scalar |
8 from telemetry.web_perf.metrics import timeline_based_metric | 8 from telemetry.web_perf.metrics import timeline_based_metric |
9 | 9 |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 NoThreads = [] | 93 NoThreads = [] |
94 FastPathThreads = ["GPU", "renderer_compositor", "browser", "IO"] | 94 FastPathThreads = ["GPU", "renderer_compositor", "browser", "IO"] |
95 | 95 |
96 ReportMainThreadOnly = ["renderer_main"] | 96 ReportMainThreadOnly = ["renderer_main"] |
97 ReportSilkDetails = ["renderer_main"] | 97 ReportSilkDetails = ["renderer_main"] |
98 | 98 |
99 # TODO(epenner): Thread names above are likely fairly stable but trace names | 99 # TODO(epenner): Thread names above are likely fairly stable but trace names |
100 # could change. We should formalize these traces to keep this robust. | 100 # could change. We should formalize these traces to keep this robust. |
101 OverheadTraceCategory = "trace_event_overhead" | 101 OverheadTraceCategory = "trace_event_overhead" |
102 OverheadTraceName = "overhead" | 102 OverheadTraceName = "overhead" |
103 FrameTraceName = "::SwapBuffers" | 103 FrameTraceName = "::DrawLayers" |
danakj
2016/10/20 22:25:43
Should this be LayerTreeHostImpl::DrawLayers maybe
| |
104 FrameTraceThreadName = "renderer_compositor" | 104 FrameTraceThreadName = "renderer_compositor" |
105 | 105 |
106 IntervalNames = ["frame", "second"] | 106 IntervalNames = ["frame", "second"] |
107 | 107 |
108 | 108 |
109 def Rate(numerator, denominator): | 109 def Rate(numerator, denominator): |
110 return DivideIfPossibleOrZero(numerator, denominator) | 110 return DivideIfPossibleOrZero(numerator, denominator) |
111 | 111 |
112 | 112 |
113 def ClockOverheadForEvent(event): | 113 def ClockOverheadForEvent(event): |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 thread_results.AddDetailedResults( | 315 thread_results.AddDetailedResults( |
316 num_intervals, interval_name, results) | 316 num_intervals, interval_name, results) |
317 | 317 |
318 # Report mean frame time for the frame rate thread. We could report other | 318 # Report mean frame time for the frame rate thread. We could report other |
319 # frame rates (e.g. renderer_main) but this might get confusing. | 319 # frame rates (e.g. renderer_main) but this might get confusing. |
320 mean_frame_time = Rate(frame_rate_thread.all_action_time, num_frames) | 320 mean_frame_time = Rate(frame_rate_thread.all_action_time, num_frames) |
321 results.AddValue(scalar.ScalarValue( | 321 results.AddValue(scalar.ScalarValue( |
322 results.current_page, | 322 results.current_page, |
323 ThreadMeanFrameTimeResultName(FrameTraceThreadName), | 323 ThreadMeanFrameTimeResultName(FrameTraceThreadName), |
324 "ms", mean_frame_time)) | 324 "ms", mean_frame_time)) |
OLD | NEW |