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

Side by Side Diff: tracing/tracing/ui/analysis/related_events.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 (c) 2015 The Chromium Authors. All rights reserved. 3 Copyright (c) 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/range.html"> 8 <link rel="import" href="/tracing/base/math/range.html">
9 <link rel="import" href="/tracing/base/task.html"> 9 <link rel="import" href="/tracing/base/task.html">
10 <link rel="import" href="/tracing/model/event_set.html"> 10 <link rel="import" href="/tracing/model/event_set.html">
11 <link rel="import" href="/tracing/ui/analysis/analysis_link.html"> 11 <link rel="import" href="/tracing/ui/analysis/analysis_link.html">
12 <link rel="import" href="/tracing/ui/analysis/flow_classifier.html"> 12 <link rel="import" href="/tracing/ui/analysis/flow_classifier.html">
13 <link rel="import" href="/tracing/ui/base/dom_helpers.html"> 13 <link rel="import" href="/tracing/ui/base/dom_helpers.html">
14 <link rel="import" href="/tracing/ui/base/table.html"> 14 <link rel="import" href="/tracing/ui/base/table.html">
15 15
16 <dom-module id='tr-ui-a-related-events'> 16 <dom-module id='tr-ui-a-related-events'>
17 <template> 17 <template>
18 <style> 18 <style>
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 tr.b.Task.RunWhenIdle(task); 244 tr.b.Task.RunWhenIdle(task);
245 return cancelTask; 245 return cancelTask;
246 }, 246 },
247 247
248 addOverlappingSamples_: function(eventSet) { 248 addOverlappingSamples_: function(eventSet) {
249 let samples = new tr.model.EventSet(); 249 let samples = new tr.model.EventSet();
250 for (let slice of eventSet) { 250 for (let slice of eventSet) {
251 if (!slice.parentContainer || !slice.parentContainer.samples) 251 if (!slice.parentContainer || !slice.parentContainer.samples)
252 continue; 252 continue;
253 let candidates = slice.parentContainer.samples; 253 let candidates = slice.parentContainer.samples;
254 let range = tr.b.Range.fromExplicitRange( 254 let range = tr.b.math.Range.fromExplicitRange(
255 slice.start, slice.start + slice.duration); 255 slice.start, slice.start + slice.duration);
256 let filteredSamples = range.filterArray( 256 let filteredSamples = range.filterArray(
257 candidates, function(value) {return value.start;}); 257 candidates, function(value) {return value.start;});
258 for (let sample of filteredSamples) 258 for (let sample of filteredSamples)
259 samples.push(sample); 259 samples.push(sample);
260 } 260 }
261 if (samples.length > 0) { 261 if (samples.length > 0) {
262 this.eventGroups_.push({ 262 this.eventGroups_.push({
263 type: 'Overlapping samples', 263 type: 'Overlapping samples',
264 tooltip: 'All samples overlapping the selected slice(s).', 264 tooltip: 'All samples overlapping the selected slice(s).',
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 }, 314 },
315 315
316 addOverlappingV8ICStats_: function(eventSet) { 316 addOverlappingV8ICStats_: function(eventSet) {
317 let slices = new tr.model.EventSet(); 317 let slices = new tr.model.EventSet();
318 for (let slice of eventSet) { 318 for (let slice of eventSet) {
319 if (!slice.parentContainer || !slice.parentContainer.sliceGroup) { 319 if (!slice.parentContainer || !slice.parentContainer.sliceGroup) {
320 continue; 320 continue;
321 } 321 }
322 let sliceGroup = slice.parentContainer.sliceGroup.slices; 322 let sliceGroup = slice.parentContainer.sliceGroup.slices;
323 let range = tr.b.Range.fromExplicitRange( 323 let range = tr.b.math.Range.fromExplicitRange(
324 slice.start, slice.start + slice.duration); 324 slice.start, slice.start + slice.duration);
325 let filteredSlices = range.filterArray( 325 let filteredSlices = range.filterArray(
326 sliceGroup, value => value.start); 326 sliceGroup, value => value.start);
327 let icSlices = filteredSlices.filter(x => x.title === 'V8.ICStats'); 327 let icSlices = filteredSlices.filter(x => x.title === 'V8.ICStats');
328 for (let icSlice of icSlices) 328 for (let icSlice of icSlices)
329 slices.push(icSlice); 329 slices.push(icSlice);
330 } 330 }
331 if (slices.length > 0) { 331 if (slices.length > 0) {
332 this.eventGroups_.push({ 332 this.eventGroups_.push({
333 type: 'Overlapping V8 IC stats', 333 type: 'Overlapping V8 IC stats',
334 tooltip: 'All V8 IC statistics overlapping the selected set.', 334 tooltip: 'All V8 IC statistics overlapping the selected set.',
335 selection: slices 335 selection: slices
336 }); 336 });
337 } 337 }
338 }, 338 },
339 339
340 updateContents_: function() { 340 updateContents_: function() {
341 let table = this.$.table; 341 let table = this.$.table;
342 if (this.eventGroups_ === undefined) 342 if (this.eventGroups_ === undefined)
343 table.tableRows = []; 343 table.tableRows = [];
344 else 344 else
345 table.tableRows = this.eventGroups_.slice(); 345 table.tableRows = this.eventGroups_.slice();
346 table.rebuild(); 346 table.rebuild();
347 } 347 }
348 }); 348 });
349 </script> 349 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/analysis/multi_sample_sub_view.html ('k') | tracing/tracing/ui/analysis/selection_summary_table.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698