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

Side by Side Diff: tracing/tracing/value/histogram_parameter_collector.html

Issue 2999863002: Results.html: record maximum Histogram.numValues in google analytics. (Closed)
Patch Set: fix vinn tests Created 3 years, 4 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/base/timing.html ('k') | tracing/tracing/value/ui/timings.md » ('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 2017 The Chromium Authors. All rights reserved. 3 Copyright 2017 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/timing.html">
8 <link rel="import" href="/tracing/value/histogram_grouping.html"> 9 <link rel="import" href="/tracing/value/histogram_grouping.html">
9 <link rel="import" href="/tracing/value/histogram_set.html"> 10 <link rel="import" href="/tracing/value/histogram_set.html">
10 11
11 <script> 12 <script>
12 'use strict'; 13 'use strict';
13 tr.exportTo('tr.v', function() { 14 tr.exportTo('tr.v', function() {
14 const getDisplayLabel = 15 const getDisplayLabel =
15 tr.v.HistogramGrouping.DISPLAY_LABEL.callback; 16 tr.v.HistogramGrouping.DISPLAY_LABEL.callback;
16 17
17 const DEFAULT_POSSIBLE_GROUPS = []; 18 const DEFAULT_POSSIBLE_GROUPS = [];
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 this.keysToValues_ = new Map(DEFAULT_POSSIBLE_GROUPS.map( 51 this.keysToValues_ = new Map(DEFAULT_POSSIBLE_GROUPS.map(
51 g => [g.key, new Set()])); 52 g => [g.key, new Set()]));
52 53
53 // Never remove 'name' from keysToGroupings. 54 // Never remove 'name' from keysToGroupings.
54 this.keysToValues_.delete( 55 this.keysToValues_.delete(
55 tr.v.HistogramGrouping.HISTOGRAM_NAME.key); 56 tr.v.HistogramGrouping.HISTOGRAM_NAME.key);
56 } 57 }
57 58
58 process(histograms) { 59 process(histograms) {
59 const allStoryTags = new Set(); 60 const allStoryTags = new Set();
61 let maxSampleCount = 0;
60 for (const hist of histograms) { 62 for (const hist of histograms) {
63 maxSampleCount = Math.max(maxSampleCount, hist.numValues);
64
61 for (const statName of hist.statisticsNames) { 65 for (const statName of hist.statisticsNames) {
62 this.statisticNames_.add(statName); 66 this.statisticNames_.add(statName);
63 } 67 }
64 68
65 let startTime = hist.diagnostics.get( 69 let startTime = hist.diagnostics.get(
66 tr.v.d.RESERVED_NAMES.BENCHMARK_START); 70 tr.v.d.RESERVED_NAMES.BENCHMARK_START);
67 if (startTime !== undefined) startTime = startTime.minDate.getTime(); 71 if (startTime !== undefined) startTime = startTime.minDate.getTime();
68 72
69 const telemetry = tr.v.d.TelemetryInfo.getFromHistogram(hist); 73 const telemetry = tr.v.d.TelemetryInfo.getFromHistogram(hist);
70 74
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // keysToValues_ 120 // keysToValues_
117 const groupingKey = 'storyGroupingKey_' + key; 121 const groupingKey = 'storyGroupingKey_' + key;
118 if (this.keysToGroupings_.has(groupingKey)) continue; 122 if (this.keysToGroupings_.has(groupingKey)) continue;
119 const callback = tr.v.d.TelemetryInfo.makeStoryGroupingKeyLabelGetter( 123 const callback = tr.v.d.TelemetryInfo.makeStoryGroupingKeyLabelGetter(
120 key); 124 key);
121 this.keysToGroupings_.set(groupingKey, new tr.v.HistogramGrouping( 125 this.keysToGroupings_.set(groupingKey, new tr.v.HistogramGrouping(
122 groupingKey, callback)); 126 groupingKey, callback));
123 this.keysToValues_.set(groupingKey, new Set([callback(hist)])); 127 this.keysToValues_.set(groupingKey, new Set([callback(hist)]));
124 } 128 }
125 } 129 }
130 tr.b.Timing.instant(
131 'HistogramParameterCollector', 'maxSampleCount', maxSampleCount);
126 132
127 for (const tagGrouping of tr.v.HistogramGrouping.buildFromTags( 133 for (const tagGrouping of tr.v.HistogramGrouping.buildFromTags(
128 allStoryTags, tr.v.d.RESERVED_NAMES.STORY_TAGS)) { 134 allStoryTags, tr.v.d.RESERVED_NAMES.STORY_TAGS)) {
129 const values = new Set(); 135 const values = new Set();
130 for (const hist of histograms) { 136 for (const hist of histograms) {
131 values.add(tagGrouping.callback(hist)); 137 values.add(tagGrouping.callback(hist));
132 } 138 }
133 if (values.size > 1) { 139 if (values.size > 1) {
134 this.keysToGroupings_.set(tagGrouping.key, tagGrouping); 140 this.keysToGroupings_.set(tagGrouping.key, tagGrouping);
135 this.keysToValues_.set(tagGrouping.key, values); 141 this.keysToValues_.set(tagGrouping.key, values);
(...skipping 22 matching lines...) Expand all
158 164
159 return Array.from(this.keysToGroupings_.values()); 165 return Array.from(this.keysToGroupings_.values());
160 } 166 }
161 } 167 }
162 168
163 return { 169 return {
164 HistogramParameterCollector, 170 HistogramParameterCollector,
165 }; 171 };
166 }); 172 });
167 </script> 173 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/base/timing.html ('k') | tracing/tracing/value/ui/timings.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698