OLD | NEW |
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/math/range.html"> | 8 <link rel="import" href="/tracing/base/math/range.html"> |
9 <link rel="import" href="/tracing/base/unit.html"> | 9 <link rel="import" href="/tracing/base/unit.html"> |
10 <link rel="import" href="/tracing/extras/v8/runtime_stats_entry.html"> | 10 <link rel="import" href="/tracing/extras/v8/runtime_stats_entry.html"> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 function addDurationHistogram(railStageName, runtimeGroupName, sampleValue, | 142 function addDurationHistogram(railStageName, runtimeGroupName, sampleValue, |
143 histograms, durationRelatedHistsByGroupName) { | 143 histograms, durationRelatedHistsByGroupName) { |
144 const durationHistogram = histograms.createHistogram( | 144 const durationHistogram = histograms.createHistogram( |
145 `${railStageName}_${runtimeGroupName}:duration`, | 145 `${railStageName}_${runtimeGroupName}:duration`, |
146 tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, | 146 tr.b.Unit.byName.timeDurationInMs_smallerIsBetter, |
147 convertMicroToMilli_(sampleValue), { | 147 convertMicroToMilli_(sampleValue), { |
148 binBoundaries: DURATION_CUSTOM_BOUNDARIES, | 148 binBoundaries: DURATION_CUSTOM_BOUNDARIES, |
149 summaryOptions: SUMMARY_OPTIONS, | 149 summaryOptions: SUMMARY_OPTIONS, |
150 }); | 150 }); |
151 | 151 |
152 // Record this histogram in RelatedHistogramMap. | |
153 if (durationRelatedHistsByGroupName.get(runtimeGroupName) === | 152 if (durationRelatedHistsByGroupName.get(runtimeGroupName) === |
154 undefined) { | 153 undefined) { |
155 const durationHistogramMap = new tr.v.d.RelatedHistogramMap(); | 154 const durationHistogramMap = new tr.v.d.RelatedHistogramMap(); |
156 durationHistogramMap.set(railStageName, durationHistogram); | 155 durationHistogramMap.set(railStageName, durationHistogram); |
157 durationRelatedHistsByGroupName.set(runtimeGroupName, | 156 durationRelatedHistsByGroupName.set(runtimeGroupName, |
158 durationHistogramMap); | 157 durationHistogramMap); |
159 } else { | 158 } else { |
160 durationRelatedHistsByGroupName.get(runtimeGroupName).set(railStageName, | 159 durationRelatedHistsByGroupName.get(runtimeGroupName).set(railStageName, |
161 durationHistogram); | 160 durationHistogram); |
162 } | 161 } |
163 } | 162 } |
164 | 163 |
165 function addCountHistogram(railStageName, runtimeGroupName, sampleValue, | 164 function addCountHistogram(railStageName, runtimeGroupName, sampleValue, |
166 histograms, countRelatedHistsByGroupName) { | 165 histograms, countRelatedHistsByGroupName) { |
167 const countHistogram = histograms.createHistogram( | 166 const countHistogram = histograms.createHistogram( |
168 `${railStageName}_${runtimeGroupName}:count`, | 167 `${railStageName}_${runtimeGroupName}:count`, |
169 tr.b.Unit.byName.count_smallerIsBetter, sampleValue, { | 168 tr.b.Unit.byName.count_smallerIsBetter, sampleValue, { |
170 binBoundaries: COUNT_CUSTOM_BOUNDARIES, | 169 binBoundaries: COUNT_CUSTOM_BOUNDARIES, |
171 summaryOptions: SUMMARY_OPTIONS, | 170 summaryOptions: SUMMARY_OPTIONS, |
172 }); | 171 }); |
173 | 172 |
174 // Record this histogram in RelatedHistogramMap. | |
175 if (countRelatedHistsByGroupName.get(runtimeGroupName) === undefined) { | 173 if (countRelatedHistsByGroupName.get(runtimeGroupName) === undefined) { |
176 const countHistogramMap = new tr.v.d.RelatedHistogramMap(); | 174 const countHistogramMap = new tr.v.d.RelatedHistogramMap(); |
177 countHistogramMap.set(railStageName, countHistogram); | 175 countHistogramMap.set(railStageName, countHistogram); |
178 countRelatedHistsByGroupName.set(runtimeGroupName, | 176 countRelatedHistsByGroupName.set(runtimeGroupName, |
179 countHistogramMap); | 177 countHistogramMap); |
180 } else { | 178 } else { |
181 countRelatedHistsByGroupName.get(runtimeGroupName).set(railStageName, | 179 countRelatedHistsByGroupName.get(runtimeGroupName).set(railStageName, |
182 countHistogram); | 180 countHistogram); |
183 } | 181 } |
184 } | 182 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (countRelatedHistogram !== undefined) { | 218 if (countRelatedHistogram !== undefined) { |
221 countHistogram.diagnostics.set('RAIL stages', countRelatedHistogram); | 219 countHistogram.diagnostics.set('RAIL stages', countRelatedHistogram); |
222 } | 220 } |
223 } | 221 } |
224 | 222 |
225 function computeRuntimeStatsBucketOnUE(histograms, slices, | 223 function computeRuntimeStatsBucketOnUE(histograms, slices, |
226 v8SlicesBucketOnUEMap) { | 224 v8SlicesBucketOnUEMap) { |
227 const durationRelatedHistsByGroupName = new Map(); | 225 const durationRelatedHistsByGroupName = new Map(); |
228 const countRelatedHistsByGroupName = new Map(); | 226 const countRelatedHistsByGroupName = new Map(); |
229 | 227 |
230 // Compute runtimeStats in each of the UE buckets. Also record the | 228 // Compute runtimeStats in each of the UE buckets. These histograms are |
231 // histograms in RelatedHistogramMap. These histograms are added to the | 229 // added to the corresponding histograms in the total bucket as a |
232 // corresponding histograms in the total bucket as a diagnostic. This keeps | 230 // diagnostic. This keeps the data grouped. |
233 // the data grouped. | |
234 for (const [name, slicesUE] of v8SlicesBucketOnUEMap) { | 231 for (const [name, slicesUE] of v8SlicesBucketOnUEMap) { |
235 const runtimeGroupCollection = new tr.e.v8.RuntimeStatsGroupCollection(); | 232 const runtimeGroupCollection = new tr.e.v8.RuntimeStatsGroupCollection(); |
236 runtimeGroupCollection.addSlices(slicesUE); | 233 runtimeGroupCollection.addSlices(slicesUE); |
237 | 234 |
238 let overallV8Time = runtimeGroupCollection.totalTime; | 235 let overallV8Time = runtimeGroupCollection.totalTime; |
239 let overallV8Count = runtimeGroupCollection.totalCount; | 236 let overallV8Count = runtimeGroupCollection.totalCount; |
240 for (const runtimeGroup of runtimeGroupCollection.runtimeGroups) { | 237 for (const runtimeGroup of runtimeGroupCollection.runtimeGroups) { |
241 addDurationHistogram(name, runtimeGroup.name, runtimeGroup.time, | 238 addDurationHistogram(name, runtimeGroup.name, runtimeGroup.time, |
242 histograms, durationRelatedHistsByGroupName); | 239 histograms, durationRelatedHistsByGroupName); |
243 if (runtimeGroup.name === 'Blink C++') { | 240 if (runtimeGroup.name === 'Blink C++') { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 348 |
352 tr.metrics.MetricRegistry.register(runtimeStatsTotalMetric); | 349 tr.metrics.MetricRegistry.register(runtimeStatsTotalMetric); |
353 tr.metrics.MetricRegistry.register(runtimeStatsMetric); | 350 tr.metrics.MetricRegistry.register(runtimeStatsMetric); |
354 | 351 |
355 return { | 352 return { |
356 runtimeStatsMetric, | 353 runtimeStatsMetric, |
357 runtimeStatsTotalMetric, | 354 runtimeStatsTotalMetric, |
358 }; | 355 }; |
359 }); | 356 }); |
360 </script> | 357 </script> |
OLD | NEW |