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/range.html"> | 8 <link rel="import" href="/tracing/base/math/range.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/value/histogram.html"> | 10 <link rel="import" href="/tracing/value/histogram.html"> |
11 | 11 |
12 <script> | 12 <script> |
13 'use strict'; | 13 'use strict'; |
14 | 14 |
15 tr.exportTo('tr.metrics', function() { | 15 tr.exportTo('tr.metrics', function() { |
16 function sampleMetric(histograms, model) { | 16 function sampleMetric(histograms, model) { |
17 var hist = new tr.v.Histogram( | 17 var hist = new tr.v.Histogram( |
18 'foo', tr.b.Unit.byName.sizeInBytes_smallerIsBetter); | 18 'foo', tr.b.Unit.byName.sizeInBytes_smallerIsBetter); |
(...skipping 17 matching lines...) Expand all Loading... |
36 histograms.addHistogram(hist); | 36 histograms.addHistogram(hist); |
37 } | 37 } |
38 | 38 |
39 tr.metrics.MetricRegistry.register(sampleMetric); | 39 tr.metrics.MetricRegistry.register(sampleMetric); |
40 | 40 |
41 return { | 41 return { |
42 sampleMetric, | 42 sampleMetric, |
43 }; | 43 }; |
44 }); | 44 }); |
45 </script> | 45 </script> |
OLD | NEW |