OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
9 <link rel="import" href="/tracing/extras/chrome/estimated_input_latency.html"> | 9 <link rel="import" href="/tracing/extras/chrome/estimated_input_latency.html"> |
10 <link rel="import" href="/tracing/metrics/v8/utils.html"> | 10 <link rel="import" href="/tracing/metrics/v8/utils.html"> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 WINDOW_SIZE_MS, tasks)); | 118 WINDOW_SIZE_MS, tasks)); |
119 const interactiveTimestamps = | 119 const interactiveTimestamps = |
120 rendererToInteractiveTimestamps.get(rendererHelper.pid); | 120 rendererToInteractiveTimestamps.get(rendererHelper.pid); |
121 if (interactiveTimestamps.length === 0) continue; | 121 if (interactiveTimestamps.length === 0) continue; |
122 if (interactiveTimestamps.length > 1) { | 122 if (interactiveTimestamps.length > 1) { |
123 // TODO(ulan): Support multiple interactive time windows when | 123 // TODO(ulan): Support multiple interactive time windows when |
124 // https://crbug.com/692112 is fixed. | 124 // https://crbug.com/692112 is fixed. |
125 continue; | 125 continue; |
126 } | 126 } |
127 const interactiveWindow = | 127 const interactiveWindow = |
128 tr.b.Range.fromExplicitRange(interactiveTimestamps[0], Infinity) | 128 tr.b.math.Range.fromExplicitRange(interactiveTimestamps[0], Infinity) |
129 .findIntersection(rendererHelper.mainThread.bounds); | 129 .findIntersection(rendererHelper.mainThread.bounds); |
130 interactiveHistogram.addSample( | 130 interactiveHistogram.addSample( |
131 tr.e.chrome.maxExpectedQueueingTimeInSlidingWindow( | 131 tr.e.chrome.maxExpectedQueueingTimeInSlidingWindow( |
132 interactiveWindow.min, interactiveWindow.max, | 132 interactiveWindow.min, interactiveWindow.max, |
133 WINDOW_SIZE_MS, tasks)); | 133 WINDOW_SIZE_MS, tasks)); |
134 } | 134 } |
135 addV8ContributionToExpectedQueueingTime( | 135 addV8ContributionToExpectedQueueingTime( |
136 totalHistogram, interactiveHistogram, rendererToInteractiveTimestamps, | 136 totalHistogram, interactiveHistogram, rendererToInteractiveTimestamps, |
137 histograms, model); | 137 histograms, model); |
138 histograms.addHistogram(totalHistogram); | 138 histograms.addHistogram(totalHistogram); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 WINDOW_SIZE_MS, tasks)); | 240 WINDOW_SIZE_MS, tasks)); |
241 const interactiveTimestamps = | 241 const interactiveTimestamps = |
242 rendererToInteractiveTimestamps.get(rendererHelper.pid); | 242 rendererToInteractiveTimestamps.get(rendererHelper.pid); |
243 if (interactiveTimestamps.length === 0) continue; | 243 if (interactiveTimestamps.length === 0) continue; |
244 if (interactiveTimestamps.length > 1) { | 244 if (interactiveTimestamps.length > 1) { |
245 // TODO(ulan): Support multiple interactive time windows when | 245 // TODO(ulan): Support multiple interactive time windows when |
246 // https://crbug.com/692112 is fixed. | 246 // https://crbug.com/692112 is fixed. |
247 continue; | 247 continue; |
248 } | 248 } |
249 const interactiveWindow = | 249 const interactiveWindow = |
250 tr.b.Range.fromExplicitRange(interactiveTimestamps[0], Infinity) | 250 tr.b.math.Range.fromExplicitRange(interactiveTimestamps[0], Infinity) |
251 .findIntersection(rendererHelper.mainThread.bounds); | 251 .findIntersection(rendererHelper.mainThread.bounds); |
252 interactiveHistogram.addSample( | 252 interactiveHistogram.addSample( |
253 tr.e.chrome.maxExpectedQueueingTimeInSlidingWindow( | 253 tr.e.chrome.maxExpectedQueueingTimeInSlidingWindow( |
254 interactiveWindow.min, interactiveWindow.max, | 254 interactiveWindow.min, interactiveWindow.max, |
255 WINDOW_SIZE_MS, tasks)); | 255 WINDOW_SIZE_MS, tasks)); |
256 } | 256 } |
257 histograms.addHistogram(totalHistogram); | 257 histograms.addHistogram(totalHistogram); |
258 histograms.addHistogram(interactiveHistogram); | 258 histograms.addHistogram(interactiveHistogram); |
259 return { | 259 return { |
260 total: totalHistogram, | 260 total: totalHistogram, |
261 interactive: interactiveHistogram | 261 interactive: interactiveHistogram |
262 }; | 262 }; |
263 } | 263 } |
264 | 264 |
265 tr.metrics.MetricRegistry.register(expectedQueueingTimeMetric); | 265 tr.metrics.MetricRegistry.register(expectedQueueingTimeMetric); |
266 | 266 |
267 return { | 267 return { |
268 expectedQueueingTimeMetric, | 268 expectedQueueingTimeMetric, |
269 contributionToExpectedQueueingTime, | 269 contributionToExpectedQueueingTime, |
270 }; | 270 }; |
271 }); | 271 }); |
272 </script> | 272 </script> |
OLD | NEW |