OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 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/base/sorted_array_utils.html"> | 9 <link rel="import" href="/tracing/base/math/sorted_array_utils.html"> |
10 <link rel="import" href="/tracing/base/unit.html"> | 10 <link rel="import" href="/tracing/base/unit.html"> |
11 <link rel="import" href="/tracing/model/event.html"> | 11 <link rel="import" href="/tracing/model/event.html"> |
12 <link rel="import" href="/tracing/model/event_registry.html"> | 12 <link rel="import" href="/tracing/model/event_registry.html"> |
13 | 13 |
14 <script> | 14 <script> |
15 'use strict'; | 15 'use strict'; |
16 | 16 |
17 tr.exportTo('tr.model', function() { | 17 tr.exportTo('tr.model', function() { |
18 /** | 18 /** |
19 * The value of a given measurement at a given time. | 19 * The value of a given measurement at a given time. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 set timestamp(timestamp) { | 69 set timestamp(timestamp) { |
70 this.timestamp_ = timestamp; | 70 this.timestamp_ = timestamp; |
71 }, | 71 }, |
72 | 72 |
73 addBoundsToRange: function(range) { | 73 addBoundsToRange: function(range) { |
74 range.addValue(this.timestamp); | 74 range.addValue(this.timestamp); |
75 }, | 75 }, |
76 | 76 |
77 getSampleIndex: function() { | 77 getSampleIndex: function() { |
78 return tr.b.findLowIndexInSortedArray( | 78 return tr.b.math.findLowIndexInSortedArray( |
79 this.series.timestamps, | 79 this.series.timestamps, |
80 function(x) { return x; }, | 80 function(x) { return x; }, |
81 this.timestamp_); | 81 this.timestamp_); |
82 }, | 82 }, |
83 | 83 |
84 get userFriendlyName() { | 84 get userFriendlyName() { |
85 return 'Counter sample from ' + this.series_.title + ' at ' + | 85 return 'Counter sample from ' + this.series_.title + ' at ' + |
86 tr.b.Unit.byName.timeStampInMs.format(this.timestamp); | 86 tr.b.Unit.byName.timeStampInMs.format(this.timestamp); |
87 } | 87 } |
88 }; | 88 }; |
89 | 89 |
90 | 90 |
91 tr.model.EventRegistry.register( | 91 tr.model.EventRegistry.register( |
92 CounterSample, | 92 CounterSample, |
93 { | 93 { |
94 name: 'counterSample', | 94 name: 'counterSample', |
95 pluralName: 'counterSamples' | 95 pluralName: 'counterSamples' |
96 }); | 96 }); |
97 | 97 |
98 return { | 98 return { |
99 CounterSample, | 99 CounterSample, |
100 }; | 100 }; |
101 }); | 101 }); |
102 </script> | 102 </script> |
OLD | NEW |