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/range.html"> | 8 <link rel="import" href="/tracing/base/range.html"> |
9 <link rel="import" href="/tracing/metrics/metric_registry.html"> | 9 <link rel="import" href="/tracing/metrics/metric_registry.html"> |
10 <link rel="import" href="/tracing/metrics/v8/utils.html"> | 10 <link rel="import" href="/tracing/metrics/v8/utils.html"> |
(...skipping 19 matching lines...) Expand all Loading... |
30 addTotalIdleTimesOfTopEvents(values, model); | 30 addTotalIdleTimesOfTopEvents(values, model); |
31 addV8ExecuteMutatorUtilization(values, model); | 31 addV8ExecuteMutatorUtilization(values, model); |
32 } | 32 } |
33 | 33 |
34 tr.metrics.MetricRegistry.register(gcMetric); | 34 tr.metrics.MetricRegistry.register(gcMetric); |
35 | 35 |
36 var timeDurationInMs_smallerIsBetter = | 36 var timeDurationInMs_smallerIsBetter = |
37 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter; | 37 tr.v.Unit.byName.timeDurationInMs_smallerIsBetter; |
38 var percentage_biggerIsBetter = | 38 var percentage_biggerIsBetter = |
39 tr.v.Unit.byName.normalizedPercentage_biggerIsBetter; | 39 tr.v.Unit.byName.normalizedPercentage_biggerIsBetter; |
40 var PERCENTAGE_BUILDER = tr.v.NumericBuilder.createLinear( | |
41 percentage_biggerIsBetter, tr.b.Range.fromExplicitRange(0, 1), 20); | |
42 | 40 |
43 var numericBuilder = new tr.v.NumericBuilder( | |
44 timeDurationInMs_smallerIsBetter, 0); | |
45 // 0.1 steps from 0 to 20 since it is the most common range. | 41 // 0.1 steps from 0 to 20 since it is the most common range. |
46 numericBuilder.addLinearBins(20, 200); | |
47 // Exponentially increasing steps from 20 to 200. | 42 // Exponentially increasing steps from 20 to 200. |
48 numericBuilder.addExponentialBins(200, 100); | 43 var CUSTOM_BOUNDARIES = tr.v.HistogramBinBoundaries.createLinear(0, 20, 200) |
| 44 .addExponentialBins(200, 100); |
49 | 45 |
50 function createNumericForTopEventTime() { | 46 function createNumericForTopEventTime() { |
51 var n = numericBuilder.build(); | 47 var n = new tr.v.Histogram( |
| 48 timeDurationInMs_smallerIsBetter, CUSTOM_BOUNDARIES); |
52 n.customizeSummaryOptions({ | 49 n.customizeSummaryOptions({ |
53 avg: true, | 50 avg: true, |
54 count: true, | 51 count: true, |
55 max: true, | 52 max: true, |
56 min: false, | 53 min: false, |
57 std: true, | 54 std: true, |
58 sum: true, | 55 sum: true, |
59 percentile: [0.90]}); | 56 percentile: [0.90]}); |
60 return n; | 57 return n; |
61 } | 58 } |
62 | 59 |
63 function createNumericForSubEventTime() { | 60 function createNumericForSubEventTime() { |
64 var n = numericBuilder.build(); | 61 var n = new tr.v.Histogram( |
| 62 timeDurationInMs_smallerIsBetter, CUSTOM_BOUNDARIES); |
65 n.customizeSummaryOptions({ | 63 n.customizeSummaryOptions({ |
66 avg: true, | 64 avg: true, |
67 count: false, | 65 count: false, |
68 max: true, | 66 max: true, |
69 min: false, | 67 min: false, |
70 std: false, | 68 std: false, |
71 sum: false, | 69 sum: false, |
72 percentile: [0.90] | 70 percentile: [0.90] |
73 }); | 71 }); |
74 return n; | 72 return n; |
75 } | 73 } |
76 | 74 |
77 function createNumericForIdleTime() { | 75 function createNumericForIdleTime() { |
78 var n = numericBuilder.build(); | 76 var n = new tr.v.Histogram( |
| 77 timeDurationInMs_smallerIsBetter, CUSTOM_BOUNDARIES); |
79 n.customizeSummaryOptions({ | 78 n.customizeSummaryOptions({ |
80 avg: true, | 79 avg: true, |
81 count: false, | 80 count: false, |
82 max: true, | 81 max: true, |
83 min: false, | 82 min: false, |
84 std: false, | 83 std: false, |
85 sum: true, | 84 sum: true, |
86 percentile: [] | 85 percentile: [] |
87 }); | 86 }); |
88 return n; | 87 return n; |
89 } | 88 } |
90 | 89 |
91 function createPercentage(numerator, denominator) { | 90 function createPercentage(numerator, denominator) { |
92 var hist = PERCENTAGE_BUILDER.build(); | 91 var hist = new tr.v.Histogram(percentage_biggerIsBetter); |
93 if (denominator === 0) | 92 if (denominator === 0) |
94 hist.add(0); | 93 hist.add(0); |
95 else | 94 else |
96 hist.add(numerator / denominator); | 95 hist.add(numerator / denominator); |
97 return hist; | 96 return hist; |
98 } | 97 } |
99 | 98 |
100 function isNotForcedTopGarbageCollectionEvent(event) { | 99 function isNotForcedTopGarbageCollectionEvent(event) { |
101 // We exclude garbage collection events forced by benchmark runner, | 100 // We exclude garbage collection events forced by benchmark runner, |
102 // because they cannot happen in real world. | 101 // because they cannot happen in real world. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 end: e.end - topEvent.start + time }); | 253 end: e.end - topEvent.start + time }); |
255 } | 254 } |
256 } | 255 } |
257 time += topEvent.duration; | 256 time += topEvent.duration; |
258 } | 257 } |
259 // Now we have one big v8.execute interval from 0 to |time| and | 258 // Now we have one big v8.execute interval from 0 to |time| and |
260 // a list of GC pauses. | 259 // a list of GC pauses. |
261 var mutatorUtilization = tr.metrics.v8.utils.mutatorUtilization( | 260 var mutatorUtilization = tr.metrics.v8.utils.mutatorUtilization( |
262 0, time, WINDOW_SIZE_MS, pauses); | 261 0, time, WINDOW_SIZE_MS, pauses); |
263 [0.90, 0.95, 0.99].forEach(function(percent) { | 262 [0.90, 0.95, 0.99].forEach(function(percent) { |
264 var hist = PERCENTAGE_BUILDER.build(); | 263 var hist = new tr.v.Histogram(percentage_biggerIsBetter); |
265 hist.add(mutatorUtilization.percentile(1.0 - percent)); | 264 hist.add(mutatorUtilization.percentile(1.0 - percent)); |
266 values.addValue(new tr.v.NumericValue( | 265 values.addValue(new tr.v.NumericValue( |
267 'v8-execute-mutator-utilization_pct_0' + percent * 100, | 266 'v8-execute-mutator-utilization_pct_0' + percent * 100, |
268 hist)); | 267 hist)); |
269 }); | 268 }); |
270 var hist = PERCENTAGE_BUILDER.build(); | 269 var hist = new tr.v.Histogram(percentage_biggerIsBetter); |
271 hist.add(mutatorUtilization.min); | 270 hist.add(mutatorUtilization.min); |
272 values.addValue(new tr.v.NumericValue( | 271 values.addValue(new tr.v.NumericValue( |
273 'v8-execute-mutator-utilization_min', hist)); | 272 'v8-execute-mutator-utilization_min', hist)); |
274 } | 273 } |
275 ); | 274 ); |
276 } | 275 } |
277 | 276 |
278 return { | 277 return { |
279 gcMetric: gcMetric, | 278 gcMetric: gcMetric, |
280 WINDOW_SIZE_MS: WINDOW_SIZE_MS // For testing purposes only. | 279 WINDOW_SIZE_MS: WINDOW_SIZE_MS // For testing purposes only. |
281 }; | 280 }; |
282 }); | 281 }); |
283 </script> | 282 </script> |
OLD | NEW |