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

Side by Side Diff: Source/devtools/front_end/TimelinePanel.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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/TimelinePowerOverview.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 var aggregatedTotal = 0; 888 var aggregatedTotal = 0;
889 for (var categoryName in aggregatedStats) 889 for (var categoryName in aggregatedStats)
890 aggregatedTotal += aggregatedStats[categoryName]; 890 aggregatedTotal += aggregatedStats[categoryName];
891 aggregatedStats["idle"] = Math.max(0, endTime - startTime - aggregatedTo tal); 891 aggregatedStats["idle"] = Math.max(0, endTime - startTime - aggregatedTo tal);
892 892
893 var fragment = document.createDocumentFragment(); 893 var fragment = document.createDocumentFragment();
894 fragment.appendChild(WebInspector.TimelineUIUtils.generatePieChart(aggre gatedStats)); 894 fragment.appendChild(WebInspector.TimelineUIUtils.generatePieChart(aggre gatedStats));
895 var startOffset = startTime - this._model.minimumRecordTime(); 895 var startOffset = startTime - this._model.minimumRecordTime();
896 var endOffset = endTime - this._model.minimumRecordTime(); 896 var endOffset = endTime - this._model.minimumRecordTime();
897 var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString( startOffset), Number.millisToString(endOffset)); 897 var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString( startOffset), Number.millisToString(endOffset));
898
899 if (Capabilities.canProfilePower) {
900 var powerOverview = /** @type {!WebInspector.TimelinePowerOverview} */ (this._viewsForMode(WebInspector.TimelinePanel.Mode.Power).overviewView);
901 energy = powerOverview.calculateEnergy(startTime, endTime);
902 title += WebInspector.UIString(" Energy: %.2f Joules", energy);
903 }
898 this._detailsView.setContent(title, fragment); 904 this._detailsView.setContent(title, fragment);
899 }, 905 },
900 906
901 /** 907 /**
902 * @param {?WebInspector.TimelineModel.Record} record 908 * @param {?WebInspector.TimelineModel.Record} record
903 */ 909 */
904 selectRecord: function(record) 910 selectRecord: function(record)
905 { 911 {
906 this._detailsLinkifier.reset(); 912 this._detailsLinkifier.reset();
907 this._selectedRecord = record; 913 this._selectedRecord = record;
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 * @param {!WebInspector.TimelineModel.Record} record 1191 * @param {!WebInspector.TimelineModel.Record} record
1186 * @return {boolean} 1192 * @return {boolean}
1187 */ 1193 */
1188 accept: function(record) 1194 accept: function(record)
1189 { 1195 {
1190 return !this._hiddenRecords[record.type]; 1196 return !this._hiddenRecords[record.type];
1191 }, 1197 },
1192 1198
1193 __proto__: WebInspector.TimelineModel.Filter.prototype 1199 __proto__: WebInspector.TimelineModel.Filter.prototype
1194 } 1200 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/TimelinePowerOverview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698