Changeset 243166 in webkit
- Timestamp:
- Mar 19, 2019, 1:13:03 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/CPUTimelineOverviewGraph.js (modified) (3 diffs)
-
UserInterface/Views/TimelineOverview.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r243161 r243166 1 2019-03-19 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: CPU Usage Timeline - the right edge of each column should align with a CPU measurement 4 https://bugs.webkit.org/show_bug.cgi?id=195789 5 <rdar://problem/48915271> 6 7 Reviewed by Joseph Pecoraro. 8 9 Right now, each column is rendered such that the middle of the column is aligned with the 10 time of the CPU measurement. This could potentially be misleading, as the width/position of 11 the bar implies that there was a period of time after the actual time of the CPU measurement 12 that should be "attributed" to that same CPU measurement. 13 14 1 2 3 15 _______ 16 [ * ] 17 [ * ]_______ 18 [ * ][ * ] 19 _______[ * ][ * ] 20 [ * ][ * ][ * ] 21 [__*__][__*__][__*__] 22 A B C D E F 23 24 In this example, one might "attribute" any work done at time B to record 1, when in reality, 25 it should be "attributed" to record 2, since the CPU measurement had already been taken by 26 the time B was captured, meaning that the work for B hadn't yet been done and could 27 therefore not have affected the CPU measurement for record 1. 28 29 We should be rendering the columns such that the CPU measurement aligns with the trailing 30 edge of the column, so that all of the work that could be "attributed" to a given CPU 31 measurement comes before it. 32 33 1 2 3 34 _______ ___ 35 [ *] [ 36 [ *]_______[ 37 [ *][ *][ 38 ____[ *][ *][ 39 *][ *][ *][ 40 __*][____*][____*][__ 41 A B C D E F 42 43 NOTE: this "rendering" isn't exactly accurate, as the `*` should overlap the `]`. 44 45 Legend: 46 - `[ ]` represents a column for a CPU measurement 47 - `*` represents the time when the measurement actually takes place 48 49 * UserInterface/Views/CPUTimelineOverviewGraph.js: 50 (WI.CPUTimelineOverviewGraph.prototype.layout): 51 (WI.CPUTimelineOverviewGraph.prototype._handleChartClick): 52 * UserInterface/Views/TimelineOverview.js: 53 (WI.TimelineOverview.prototype._recordSelected): 54 1 55 2019-03-19 Devin Rousso <drousso@apple.com> 2 56 -
trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js
r243024 r243166 117 117 118 118 const includeRecordBeforeStart = true; 119 let visibleRecords = this._cpuTimeline.recordsInTimeRange(graphStartTime, visibleEndTime + (CPUTimelineOverviewGraph.samplingRatePerSecond / 2), includeRecordBeforeStart);119 let visibleRecords = this._cpuTimeline.recordsInTimeRange(graphStartTime, visibleEndTime, includeRecordBeforeStart); 120 120 if (!visibleRecords.length) 121 121 return; … … 125 125 } 126 126 127 let intervalWidth = (CPUTimelineOverviewGraph.samplingRatePerSecond / secondsPerPixel);127 let intervalWidth = CPUTimelineOverviewGraph.samplingRatePerSecond / secondsPerPixel; 128 128 const minimumDisplayHeight = 4; 129 129 130 // Bars for each record.131 130 for (let record of visibleRecords) { 132 131 let additionalClass = record === this.selectedRecord ? "selected" : undefined; 133 132 let w = intervalWidth; 134 let x = xScale(record.startTime - (CPUTimelineOverviewGraph.samplingRatePerSecond / 2));133 let x = xScale(record.startTime - CPUTimelineOverviewGraph.samplingRatePerSecond); 135 134 let h1 = Math.max(minimumDisplayHeight, yScale(record.mainThreadUsage)); 136 135 let h2 = Math.max(minimumDisplayHeight, yScale(record.mainThreadUsage + record.workerThreadUsage)); … … 201 200 202 201 let clickTime = graphStartTime + graphClickTime; 203 let record = this._cpuTimeline.closestRecordTo(clickTime );202 let record = this._cpuTimeline.closestRecordTo(clickTime + (CPUTimelineOverviewGraph.samplingRatePerSecond / 2)); 204 203 if (!record) 205 204 return; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js
r243024 r243166 789 789 if (firstRecord instanceof WI.CPUTimelineRecord) { 790 790 let selectionPadding = WI.CPUTimelineOverviewGraph.samplingRatePerSecond * 2.25; 791 this.selectionStartTime = startTime - selectionPadding ;791 this.selectionStartTime = startTime - selectionPadding - (WI.CPUTimelineOverviewGraph.samplingRatePerSecond / 2); 792 792 this.selectionDuration = endTime - startTime + (selectionPadding * 2); 793 793 } else if (startTime < this.selectionStartTime || endTime > this.selectionStartTime + this.selectionDuration) {
Note:
See TracChangeset
for help on using the changeset viewer.