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

Unified Diff: Source/devtools/front_end/TimelineUIUtils.js

Issue 220963002: DevTools: Add energy value under Timeline pie chart (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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
Index: Source/devtools/front_end/TimelineUIUtils.js
diff --git a/Source/devtools/front_end/TimelineUIUtils.js b/Source/devtools/front_end/TimelineUIUtils.js
index b7c73e81f7d4aaae5f6aa1da63562c13a02eff34..99355e6cf6b249ad0d46fc2a7cd65a098383f41d 100644
--- a/Source/devtools/front_end/TimelineUIUtils.js
+++ b/Source/devtools/front_end/TimelineUIUtils.js
@@ -43,7 +43,8 @@ WebInspector.TimelineUIUtils.categories = function()
rendering: new WebInspector.TimelineCategory("rendering", WebInspector.UIString("Rendering"), 2, "hsl(256, 50%, 60%)", "hsl(256, 67%, 90%)", "hsl(256, 67%, 76%)", "hsl(256, 67%, 70%)"),
painting: new WebInspector.TimelineCategory("painting", WebInspector.UIString("Painting"), 2, "hsl(109, 33%, 47%)", "hsl(109, 33%, 90%)", "hsl(109, 33%, 64%)", "hsl(109, 33%, 55%)"),
other: new WebInspector.TimelineCategory("other", WebInspector.UIString("Other"), -1, "hsl(0, 0%, 73%)", "hsl(0, 0%, 90%)", "hsl(0, 0%, 87%)", "hsl(0, 0%, 79%)"),
- idle: new WebInspector.TimelineCategory("idle", WebInspector.UIString("Idle"), -1, "hsl(0, 0%, 87%)", "hsl(0, 100%, 100%)", "hsl(0, 100%, 100%)", "hsl(0, 100%, 100%)")
+ idle: new WebInspector.TimelineCategory("idle", WebInspector.UIString("Idle"), -1, "hsl(0, 0%, 87%)", "hsl(0, 100%, 100%)", "hsl(0, 100%, 100%)", "hsl(0, 100%, 100%)"),
+ power: new WebInspector.TimelineCategory("power", WebInspector.UIString("Power"), -1, "hsl(16, 100%, 50%)", "hsl(16, 100%, 70%)", "hsl(16, 100%, 60%)", "hsl(16, 100%, 60%)")
};
return WebInspector.TimelineUIUtils._categories;
};
@@ -295,9 +296,10 @@ WebInspector.TimelineUIUtils._generateAggregatedInfo = function(aggregatedStats)
* @param {!Object} aggregatedStats
* @param {!WebInspector.TimelineCategory=} selfCategory
* @param {number=} selfTime
+ * @param {number=} energy
* @return {!Element}
*/
-WebInspector.TimelineUIUtils.generatePieChart = function(aggregatedStats, selfCategory, selfTime)
+WebInspector.TimelineUIUtils.generatePieChart = function(aggregatedStats, selfCategory, selfTime, energy)
pfeldman 2014/04/11 12:17:49 I don't think energy fits here well - it used to b
{
var element = document.createElement("div");
element.className = "timeline-aggregated-info";
@@ -346,6 +348,12 @@ WebInspector.TimelineUIUtils.generatePieChart = function(aggregatedStats, selfCa
rowElement.createChild("div", "timeline-aggregated-category timeline-" + category.name);
rowElement.createTextChild(WebInspector.UIString("%s %s", formatter(value), category.title));
}
+
+ if (energy) {
+ var rowElement = footerElement.createChild("div");
+ rowElement.createChild("div", "timeline-aggregated-category timeline-power");
+ rowElement.createTextChild(WebInspector.UIString("Energy: %.2f Joules", energy));
+ }
return element;
}

Powered by Google App Engine
This is Rietveld 408576698