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

Unified Diff: tools/plot-timer-events.js

Issue 11975045: Add a percentage to each metric in the V8 timeline plot (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Used ExcludeRanges() Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/plot-timer-events.js
diff --git a/tools/plot-timer-events.js b/tools/plot-timer-events.js
index 0a5e5221ae210523f8de835265aad981b1bd1786..00e40f8cfe42ce5222702701c0a210632fe5a6ef 100644
--- a/tools/plot-timer-events.js
+++ b/tools/plot-timer-events.js
@@ -500,11 +500,26 @@ function GnuplotOutput() {
print("set xtics out nomirror");
print("unset key");
+ var percentages = {};
+ var total = 0;
+ for (var name in TimerEvents) {
+ var event = TimerEvents[name];
+ var ranges = MergeRanges(event.ranges);
+ var exclude_ranges = [new Range(-Infinity, xrange_start),
+ new Range(xrange_end, Infinity)];
+ ranges = ExcludeRanges(ranges, exclude_ranges);
+ var sum = 0;
+ for (var i = 0; i < ranges.length; i++) {
+ sum += ranges[i].end - ranges[i].start;
+ }
+ percentages[name] = (sum / (xrange_end - xrange_start) * 100).toFixed(1);
+ }
+
// Name Y-axis.
var ytics = [];
for (name in TimerEvents) {
var index = TimerEvents[name].index;
- ytics.push('"' + name + '"' + ' ' + index);
+ ytics.push('"' + name + ' (' + percentages[name] + '%%)" ' + index);
}
ytics.push('"code kind being executed"' + ' ' + (kY1Offset - 1));
ytics.push('"top ' + kStackFrames + ' js stack frames"' + ' ' +
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698