| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 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/statistics.html"> | 8 <link rel="import" href="/tracing/base/statistics.html"> |
| 9 <link rel="import" href="/tracing/metrics/metric_registry.html"> | 9 <link rel="import" href="/tracing/metrics/metric_registry.html"> |
| 10 <link rel="import" href="/tracing/metrics/system_health/utils.html"> | 10 <link rel="import" href="/tracing/metrics/system_health/utils.html"> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 firstPaintEvents.push(ev); | 108 firstPaintEvents.push(ev); |
| 109 }, this); | 109 }, this); |
| 110 | 110 |
| 111 return firstPaintEvents; | 111 return firstPaintEvents; |
| 112 } | 112 } |
| 113 | 113 |
| 114 function prepareTelemetryInternalEventPredicate(rendererHelper) { | 114 function prepareTelemetryInternalEventPredicate(rendererHelper) { |
| 115 var ignoreRegions = []; | 115 var ignoreRegions = []; |
| 116 | 116 |
| 117 var warmCacheStart; | 117 var internalRegionStart; |
| 118 rendererHelper.mainThread.asyncSliceGroup.iterateAllEventsInThisContainer( | 118 rendererHelper.mainThread.asyncSliceGroup.iterateAllEventsInThisContainer( |
| 119 () => true, function(slice) { | 119 () => true, function(slice) { |
| 120 if (slice.title === 'telemetry.internal.warmCache.start') | 120 if (!!slice.title.match(/^telemetry\.internal\.[^.]*\.start$/)) |
| 121 warmCacheStart = slice.start; | 121 internalRegionStart = slice.start; |
| 122 if (slice.title === 'telemetry.internal.warmCache.end') { | 122 if (!!slice.title.match(/^telemetry\.internal\.[^.]*\.end$/)) { |
| 123 var warmCacheTimedEvent = new tr.model.TimedEvent(warmCacheStart); | 123 var timedEvent = new tr.model.TimedEvent(internalRegionStart); |
| 124 warmCacheTimedEvent.duration = slice.end - warmCacheStart; | 124 timedEvent.duration = slice.end - internalRegionStart; |
| 125 | 125 ignoreRegions.push(timedEvent); |
| 126 ignoreRegions.push(warmCacheTimedEvent); | |
| 127 } | 126 } |
| 128 }, this); | 127 }, this); |
| 129 | 128 |
| 130 return function isTelemetryInternalEvent(slice) { | 129 return function isTelemetryInternalEvent(slice) { |
| 131 for (var i = 0; i < ignoreRegions.length; ++ i) { | 130 for (var i = 0; i < ignoreRegions.length; ++ i) { |
| 132 if (ignoreRegions[i].bounds(slice)) | 131 if (ignoreRegions[i].bounds(slice)) |
| 133 return true; | 132 return true; |
| 134 } | 133 } |
| 135 return false; | 134 return false; |
| 136 } | 135 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 __proto__: Function.prototype | 190 __proto__: Function.prototype |
| 192 }; | 191 }; |
| 193 | 192 |
| 194 tr.metrics.MetricRegistry.register(firstPaintMetric); | 193 tr.metrics.MetricRegistry.register(firstPaintMetric); |
| 195 | 194 |
| 196 return { | 195 return { |
| 197 firstPaintMetric: firstPaintMetric | 196 firstPaintMetric: firstPaintMetric |
| 198 }; | 197 }; |
| 199 }); | 198 }); |
| 200 </script> | 199 </script> |
| OLD | NEW |