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

Side by Side Diff: tracing/tracing/ui/side_panel/metrics_side_panel.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
OLDNEW
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/raf.html"> 8 <link rel="import" href="/tracing/base/raf.html">
9 <link rel="import" href="/tracing/metrics/metric_map_function.html"> 9 <link rel="import" href="/tracing/metrics/metric_map_function.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
82 Polymer.dom(this.$.top_left_controls).appendChild(this.recomputeButton_); 82 Polymer.dom(this.$.top_left_controls).appendChild(this.recomputeButton_);
83 }, 83 },
84 84
85 /** 85 /**
86 * Return an estimate of how many milliseconds it would take to re-run the 86 * Return an estimate of how many milliseconds it would take to re-run the
87 * metric. If the metric has not been run, return undefined. 87 * metric. If the metric has not been run, return undefined.
88 * 88 *
89 * @return {undefined|number} 89 * @return {undefined|number}
90 */ 90 */
91 get metricLatencyMs() { 91 get metricLatencyMs() {
92 return tr.b.Statistics.mean(this.metricLatenciesMs_); 92 return tr.b.math.Statistics.mean(this.metricLatenciesMs_);
93 }, 93 },
94 94
95 onMetricChange_: function() { 95 onMetricChange_: function() {
96 this.currentMetricTypeInfo_ = 96 this.currentMetricTypeInfo_ =
97 tr.metrics.MetricRegistry.findTypeInfoWithName( 97 tr.metrics.MetricRegistry.findTypeInfoWithName(
98 this.currentMetricName_); 98 this.currentMetricName_);
99 this.metricLatenciesMs_ = []; 99 this.metricLatenciesMs_ = [];
100 this.updateContents_(); 100 this.updateContents_();
101 }, 101 },
102 102
(...skipping 29 matching lines...) Expand all
132 132
133 get selection() { 133 get selection() {
134 // Not applicable to metrics. 134 // Not applicable to metrics.
135 }, 135 },
136 136
137 set selection(_) { 137 set selection(_) {
138 // Not applicable to metrics. 138 // Not applicable to metrics.
139 }, 139 },
140 140
141 /** 141 /**
142 * @return {undefined|!tr.b.Range} 142 * @return {undefined|!tr.b.math.Range}
143 */ 143 */
144 get rangeOfInterest() { 144 get rangeOfInterest() {
145 return this.rangeOfInterest_; 145 return this.rangeOfInterest_;
146 }, 146 },
147 147
148 /** 148 /**
149 * This may be called rapidly as the mouse is moved. 149 * This may be called rapidly as the mouse is moved.
150 * If the metric supportsRangeOfInterest and takes less than 100ms, then it 150 * If the metric supportsRangeOfInterest and takes less than 100ms, then it
151 * will be re-run immediately; otherwise, the Recompute button will be 151 * will be re-run immediately; otherwise, the Recompute button will be
152 * enabled. 152 * enabled.
153 * 153 *
154 * @param {!tr.b.Range} range 154 * @param {!tr.b.math.Range} range
155 */ 155 */
156 set rangeOfInterest(range) { 156 set rangeOfInterest(range) {
157 this.rangeOfInterest_ = range; 157 this.rangeOfInterest_ = range;
158 158
159 if (this.currentMetricTypeInfo_ && 159 if (this.currentMetricTypeInfo_ &&
160 this.currentMetricTypeInfo_.metadata.supportsRangeOfInterest) { 160 this.currentMetricTypeInfo_.metadata.supportsRangeOfInterest) {
161 if ((this.metricLatencyMs === undefined) || 161 if ((this.metricLatencyMs === undefined) ||
162 (this.metricLatencyMs < 100)) { 162 (this.metricLatencyMs < 100)) {
163 this.updateContents_(); 163 this.updateContents_();
164 } else { 164 } else {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 }); 204 });
205 205
206 tr.ui.side_panel.SidePanelRegistry.register(function() { 206 tr.ui.side_panel.SidePanelRegistry.register(function() {
207 return document.createElement('tr-ui-sp-metrics-side-panel'); 207 return document.createElement('tr-ui-sp-metrics-side-panel');
208 }); 208 });
209 209
210 return {}; 210 return {};
211 }); 211 });
212 </script> 212 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/side_panel/file_size_stats_side_panel.html ('k') | tracing/tracing/ui/side_panel/side_panel_container.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698