| 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/math/range.html"> | 8 <link rel="import" href="/tracing/base/math/range.html"> |
| 9 <link rel="import" href="/tracing/base/unit.html"> | 9 <link rel="import" href="/tracing/base/unit.html"> |
| 10 <link rel="import" href="/tracing/metrics/metric_registry.html"> | 10 <link rel="import" href="/tracing/metrics/metric_registry.html"> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 min: false, | 82 min: false, |
| 83 std: false, | 83 std: false, |
| 84 sum: true, | 84 sum: true, |
| 85 percentile: [] | 85 percentile: [] |
| 86 }); | 86 }); |
| 87 return n; | 87 return n; |
| 88 } | 88 } |
| 89 | 89 |
| 90 function createPercentage(name, numerator, denominator, unit) { | 90 function createPercentage(name, numerator, denominator, unit) { |
| 91 var hist = new tr.v.Histogram(name, unit); | 91 var hist = new tr.v.Histogram(name, unit); |
| 92 if (denominator === 0) | 92 if (denominator === 0) { |
| 93 hist.addSample(0); | 93 hist.addSample(0); |
| 94 else | 94 } else { |
| 95 hist.addSample(numerator / denominator); | 95 hist.addSample(numerator / denominator); |
| 96 } |
| 96 hist.customizeSummaryOptions({ | 97 hist.customizeSummaryOptions({ |
| 97 avg: true, | 98 avg: true, |
| 98 count: false, | 99 count: false, |
| 99 max: false, | 100 max: false, |
| 100 min: false, | 101 min: false, |
| 101 std: false, | 102 std: false, |
| 102 sum: false, | 103 sum: false, |
| 103 percentile: [] | 104 percentile: [] |
| 104 }); | 105 }); |
| 105 return hist; | 106 return hist; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 cpuDurationTotal, percentage_smallerIsBetter); | 218 cpuDurationTotal, percentage_smallerIsBetter); |
| 218 histograms.addHistogram(percentage); | 219 histograms.addHistogram(percentage); |
| 219 } | 220 } |
| 220 | 221 |
| 221 return { | 222 return { |
| 222 gcMetric, | 223 gcMetric, |
| 223 WINDOW_SIZE_MS, // For testing purposes only. | 224 WINDOW_SIZE_MS, // For testing purposes only. |
| 224 }; | 225 }; |
| 225 }); | 226 }); |
| 226 </script> | 227 </script> |
| OLD | NEW |