Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: tracing/tracing/model/counter_sample.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tracing/tracing/model/counter.html ('k') | tracing/tracing/model/cpu.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « tracing/tracing/model/counter.html ('k') | tracing/tracing/model/cpu.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698