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

Side by Side Diff: tracing/tracing/ui/side_panel/file_size_stats_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 2015 The Chromium Authors. All rights reserved. 3 Copyright 2015 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/statistics.html">
8 <link rel="import" href="/tracing/base/scalar.html"> 9 <link rel="import" href="/tracing/base/scalar.html">
9 <link rel="import" href="/tracing/base/statistics.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/ui/base/grouping_table.html"> 11 <link rel="import" href="/tracing/ui/base/grouping_table.html">
12 <link rel="import" href="/tracing/ui/base/grouping_table_groupby_picker.html"> 12 <link rel="import" href="/tracing/ui/base/grouping_table_groupby_picker.html">
13 <link rel="import" href="/tracing/ui/base/table.html"> 13 <link rel="import" href="/tracing/ui/base/table.html">
14 <link rel="import" href="/tracing/ui/side_panel/side_panel.html"> 14 <link rel="import" href="/tracing/ui/side_panel/side_panel.html">
15 <link rel="import" href="/tracing/ui/side_panel/side_panel_registry.html"> 15 <link rel="import" href="/tracing/ui/side_panel/side_panel_registry.html">
16 <link rel="import" href="/tracing/value/ui/scalar_span.html"> 16 <link rel="import" href="/tracing/value/ui/scalar_span.html">
17 17
18 <dom-module id='tr-ui-sp-file-size-stats-side-panel'> 18 <dom-module id='tr-ui-sp-file-size-stats-side-panel'>
19 <template> 19 <template>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 }); 178 });
179 } 179 }
180 return columns; 180 return columns;
181 }, 181 },
182 182
183 updateContents_: function() { 183 updateContents_: function() {
184 var table = this.$.table; 184 var table = this.$.table;
185 185
186 var columns = this.createColumns_(this.model.stats); 186 var columns = this.createColumns_(this.model.stats);
187 table.rowStatsConstructor = function ModelStatsRowStats(row) { 187 table.rowStatsConstructor = function ModelStatsRowStats(row) {
188 var sum = tr.b.Statistics.sum(row.data, function(x) { 188 var sum = tr.b.math.Statistics.sum(row.data, function(x) {
189 return x.numEvents; 189 return x.numEvents;
190 }); 190 });
191 var totalEventSizeinBytes = tr.b.Statistics.sum(row.data, function(x) { 191 var totalEventSizeinBytes = tr.b.math.Statistics.sum(row.data, x =>
192 return x.totalEventSizeinBytes; 192 x.totalEventSizeinBytes
193 }); 193 );
194 return { 194 return {
195 numEvents: sum, 195 numEvents: sum,
196 totalEventSizeinBytes: totalEventSizeinBytes 196 totalEventSizeinBytes: totalEventSizeinBytes
197 }; 197 };
198 }; 198 };
199 table.tableColumns = columns; 199 table.tableColumns = columns;
200 table.sortColumnIndex = 1; 200 table.sortColumnIndex = 1;
201 table.sortDescending = true; 201 table.sortDescending = true;
202 table.selectionMode = tr.ui.b.TableFormat.SelectionMode.ROW; 202 table.selectionMode = tr.ui.b.TableFormat.SelectionMode.ROW;
203 203
204 table.groupBy = this.$.picker.currentGroups.map(function(group) { 204 table.groupBy = this.$.picker.currentGroups.map(function(group) {
205 return group.dataFn; 205 return group.dataFn;
206 }); 206 });
207 207
208 if (!this.model) { 208 if (!this.model) {
209 table.dataToGroup = []; 209 table.dataToGroup = [];
210 } else { 210 } else {
211 table.dataToGroup = this.model.stats.allTraceEventStats; 211 table.dataToGroup = this.model.stats.allTraceEventStats;
212 } 212 }
213 this.$.table.rebuild(); 213 this.$.table.rebuild();
214 } 214 }
215 }); 215 });
216 216
217 tr.ui.side_panel.SidePanelRegistry.register(function() { 217 tr.ui.side_panel.SidePanelRegistry.register(function() {
218 return document.createElement('tr-ui-sp-file-size-stats-side-panel'); 218 return document.createElement('tr-ui-sp-file-size-stats-side-panel');
219 }); 219 });
220 })(); 220 })();
221 </script> 221 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698