| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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/math/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"> |
| 11 <link rel="import" href="/tracing/model/user_model/animation_expectation.html"> | 11 <link rel="import" href="/tracing/model/user_model/animation_expectation.html"> |
| 12 <link rel="import" href="/tracing/model/user_model/load_expectation.html"> | 12 <link rel="import" href="/tracing/model/user_model/load_expectation.html"> |
| 13 <link rel="import" href="/tracing/model/user_model/response_expectation.html"> | 13 <link rel="import" href="/tracing/model/user_model/response_expectation.html"> |
| 14 <link rel="import" href="/tracing/value/histogram.html"> | 14 <link rel="import" href="/tracing/value/histogram.html"> |
| 15 | 15 |
| 16 <script> | 16 <script> |
| 17 'use strict'; | 17 'use strict'; |
| 18 | 18 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 animationExpectation.frameEvents.length === 0) | 44 animationExpectation.frameEvents.length === 0) |
| 45 throw new Error('Animation missing frameEvents ' + | 45 throw new Error('Animation missing frameEvents ' + |
| 46 animationExpectation.stableId); | 46 animationExpectation.stableId); |
| 47 | 47 |
| 48 var frameTimestamps = animationExpectation.frameEvents; | 48 var frameTimestamps = animationExpectation.frameEvents; |
| 49 frameTimestamps = frameTimestamps.toArray().map(function(event) { | 49 frameTimestamps = frameTimestamps.toArray().map(function(event) { |
| 50 return event.start; | 50 return event.start; |
| 51 }); | 51 }); |
| 52 | 52 |
| 53 var absolute = true; | 53 var absolute = true; |
| 54 return tr.b.Statistics.timestampsDiscrepancy(frameTimestamps, absolute); | 54 return tr.b.math.Statistics.timestampsDiscrepancy( |
| 55 frameTimestamps, absolute); |
| 55 } | 56 } |
| 56 | 57 |
| 57 /** | 58 /** |
| 58 * @param {!tr.v.HistogramSet} histograms | 59 * @param {!tr.v.HistogramSet} histograms |
| 59 * @param {!tr.model.Model} model | 60 * @param {!tr.model.Model} model |
| 60 * @param {!Object=} opt_options | 61 * @param {!Object=} opt_options |
| 61 */ | 62 */ |
| 62 function responsivenessMetric(histograms, model, opt_options) { | 63 function responsivenessMetric(histograms, model, opt_options) { |
| 63 var responseNumeric = new tr.v.Histogram('response latency', | 64 var responseNumeric = new tr.v.Histogram('response latency', |
| 64 tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, | 65 tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 146 |
| 146 tr.metrics.MetricRegistry.register(responsivenessMetric, { | 147 tr.metrics.MetricRegistry.register(responsivenessMetric, { |
| 147 supportsRangeOfInterest: true | 148 supportsRangeOfInterest: true |
| 148 }); | 149 }); |
| 149 | 150 |
| 150 return { | 151 return { |
| 151 responsivenessMetric, | 152 responsivenessMetric, |
| 152 }; | 153 }; |
| 153 }); | 154 }); |
| 154 </script> | 155 </script> |
| OLD | NEW |