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

Side by Side Diff: tracing/tracing/metrics/system_health/long_tasks_metric.html

Issue 2283213002: Rename Histogram.add() to addSample(). (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 3 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" 8 <link rel="import"
9 href="/tracing/extras/chrome/chrome_user_friendly_category_driver.html"> 9 href="/tracing/extras/chrome/chrome_user_friendly_category_driver.html">
10 <link rel="import" href="/tracing/metrics/metric_registry.html"> 10 <link rel="import" href="/tracing/metrics/metric_registry.html">
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 function longTasksMetric(values, model, opt_options) { 75 function longTasksMetric(values, model, opt_options) {
76 var rangeOfInterest = opt_options ? opt_options.rangeOfInterest : undefined; 76 var rangeOfInterest = opt_options ? opt_options.rangeOfInterest : undefined;
77 var longTaskNumeric = new 77 var longTaskNumeric = new
78 tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs_smallerIsBetter, 78 tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs_smallerIsBetter,
79 tr.v.HistogramBinBoundaries.createLinear( 79 tr.v.HistogramBinBoundaries.createLinear(
80 LONG_TASK_MS, LONGEST_TASK_MS, 40)); 80 LONG_TASK_MS, LONGEST_TASK_MS, 40));
81 var slices = new tr.model.EventSet(); 81 var slices = new tr.model.EventSet();
82 iterateRendererMainThreads(model, function(thread) { 82 iterateRendererMainThreads(model, function(thread) {
83 iterateLongTopLevelTasksOnThreadInRange( 83 iterateLongTopLevelTasksOnThreadInRange(
84 thread, rangeOfInterest, function(task) { 84 thread, rangeOfInterest, function(task) {
85 longTaskNumeric.add(task.duration, tr.v.d.DiagnosticMap.fromObject({ 85 longTaskNumeric.addSample(task.duration,
86 relatedEvents: new tr.v.d.RelatedEventSet([task])})); 86 {relatedEvents: new tr.v.d.RelatedEventSet([task])});
87 slices.push(task); 87 slices.push(task);
88 slices.addEventSet(task.descendentSlices); 88 slices.addEventSet(task.descendentSlices);
89 }); 89 });
90 }); 90 });
91 var options = {description: 'durations of long tasks'}; 91 var options = {description: 'durations of long tasks'};
92 var longTaskValue = new tr.v.NumericValue( 92 var longTaskValue = new tr.v.NumericValue(
93 'long tasks', longTaskNumeric, options); 93 'long tasks', longTaskNumeric, options);
94 values.addValue(longTaskValue); 94 values.addValue(longTaskValue);
95 95
96 var sampleForEvent = undefined; 96 var sampleForEvent = undefined;
(...skipping 14 matching lines...) Expand all
111 return { 111 return {
112 longTasksMetric: longTasksMetric, 112 longTasksMetric: longTasksMetric,
113 iterateLongTopLevelTasksOnThreadInRange: 113 iterateLongTopLevelTasksOnThreadInRange:
114 iterateLongTopLevelTasksOnThreadInRange, 114 iterateLongTopLevelTasksOnThreadInRange,
115 iterateRendererMainThreads: iterateRendererMainThreads, 115 iterateRendererMainThreads: iterateRendererMainThreads,
116 LONG_TASK_MS: LONG_TASK_MS, 116 LONG_TASK_MS: LONG_TASK_MS,
117 LONGEST_TASK_MS: LONGEST_TASK_MS 117 LONGEST_TASK_MS: LONGEST_TASK_MS
118 }; 118 };
119 }); 119 });
120 </script> 120 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/metrics/system_health/loading_metric.html ('k') | tracing/tracing/metrics/system_health/memory_metric.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698