Chromium Code Reviews| Index: tracing/tracing/metrics/v8/gc_metric.html |
| diff --git a/tracing/tracing/metrics/v8/gc_metric.html b/tracing/tracing/metrics/v8/gc_metric.html |
| index 3243402f13b6da68883493752a8a9e43055aae57..97e1f0bb796888531f52c85c95c1fef0eba76326 100644 |
| --- a/tracing/tracing/metrics/v8/gc_metric.html |
| +++ b/tracing/tracing/metrics/v8/gc_metric.html |
| @@ -21,6 +21,7 @@ tr.exportTo('tr.metrics.v8', function() { |
| addDurationOfSubEvents(valueList, model); |
| addIdleTimesOfTopEvents(valueList, model); |
| addTotalIdleTimesOfTopEvents(valueList, model); |
| + addMutatorUtilization(valueList, model); |
| } |
| gcMetric.prototype = { |
| @@ -159,7 +160,6 @@ tr.exportTo('tr.metrics.v8', function() { |
| var overrun = 0; |
| if (idleTask) { |
| var allottedTime = idleTask['args']['allotted_time_ms']; |
| - console.log(allottedTime); |
| if (event.duration > allottedTime) { |
| overrun = event.duration - allottedTime; |
| // Don't count time over the deadline as being inside idle time. |
| @@ -191,6 +191,50 @@ tr.exportTo('tr.metrics.v8', function() { |
| stageTitle + '-' + name + '_percentage_idle', percentage)); |
| } |
| + function addMutatorUtilization(valueList, model) { |
| + // As a window size we take the duration of one frame corresponding to 60 |
| + // FPS rendering. |
| + var WINDOW_SIZE = 16.67; |
|
petrcermak
2016/04/22 11:40:01
please move this to the module scope (after line 1
ulan
2016/04/22 12:32:27
Done.
|
| + groupAndProcessEvents(model, |
| + tr.metrics.v8.utils.isTopV8ExecuteEvent, |
| + event => 'v8.execute', |
| + function(stageTitle, name, events) { |
| + events.sort((a, b) => a.start - b.start); |
| + var time = 0; |
| + var pauses = []; |
| + // Glue together the v8.execute events and adjust the GC pause |
| + // times accordingly. |
| + events.forEach(function(topEvent) { |
| + topEvent.findTopmostSlicesRelativeToThisSlice(function(e) { |
| + if (tr.metrics.v8.utils.isTopGarbageCollectionEvent(e)) { |
| + pauses.push({ start: e.start - topEvent.start + time, |
| + end: e.end - topEvent.start + time }); |
| + } |
| + }); |
| + time += topEvent.duration; |
| + }); |
| + // Now we have one big v8.execute interval from 0 to |time| and |
| + // a list of GC pauses. |
| + var mutatorUtilization = |
| + tr.metrics.v8.utils.mutatorUtilization( |
|
petrcermak
2016/04/22 11:40:01
nit: would this really not fit on the previous lin
ulan
2016/04/22 12:32:27
Done.
|
| + 0, time, WINDOW_SIZE, pauses); |
| + [0.95, 0.99].forEach(function(percent) { |
| + var value = new tr.v.ScalarNumeric(percentage_biggerIsBetter, |
| + mutatorUtilization.percentile(1.0 - percent) * 100); |
| + valueList.addValue( |
| + new tr.v.NumericValue(model.canonicalUrl, |
| + stageTitle + '-mutator_utilization_pct' + percent * 100, |
| + value)); |
| + }); |
| + var value = new tr.v.ScalarNumeric(percentage_biggerIsBetter, |
| + mutatorUtilization.min); |
| + valueList.addValue( |
| + new tr.v.NumericValue(model.canonicalUrl, |
|
petrcermak
2016/04/22 11:40:01
ditto
ulan
2016/04/22 12:32:27
Done.
|
| + stageTitle + '-mutator_utilization_min', value)); |
| + } |
| + ); |
| + } |
| + |
| /** |
| * Filters events using the |filterCallback|, then groups events by the user |
| * expectation stage title and the name computed using the |nameCallback|, |