Title: [242243] trunk/Source/WebInspectorUI
- Revision
- 242243
- Author
- joep...@webkit.org
- Date
- 2019-02-28 16:48:07 -0800 (Thu, 28 Feb 2019)
Log Message
Web Inspector: CPU Usage: Worker thread that dies might stay at a high value forever
https://bugs.webkit.org/show_bug.cgi?id=195148
Reviewed by Matt Baker.
* UserInterface/Views/CPUTimelineView.js:
(CPUTimelineView.prototype.layout):
Handle workers dieing or at least zeroing out between records.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (242242 => 242243)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-03-01 00:48:04 UTC (rev 242242)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-03-01 00:48:07 UTC (rev 242243)
@@ -1,5 +1,16 @@
2019-02-28 Joseph Pecoraro <pecor...@apple.com>
+ Web Inspector: CPU Usage: Worker thread that dies might stay at a high value forever
+ https://bugs.webkit.org/show_bug.cgi?id=195148
+
+ Reviewed by Matt Baker.
+
+ * UserInterface/Views/CPUTimelineView.js:
+ (CPUTimelineView.prototype.layout):
+ Handle workers dieing or at least zeroing out between records.
+
+2019-02-28 Joseph Pecoraro <pecor...@apple.com>
+
Web Inspector: CPU Usage Timeline - Make Threads section expandable / collapsable
https://bugs.webkit.org/show_bug.cgi?id=195085
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js (242242 => 242243)
--- trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js 2019-03-01 00:48:04 UTC (rev 242242)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js 2019-03-01 00:48:07 UTC (rev 242243)
@@ -301,6 +301,7 @@
let dataPoints = [];
let workersDataMap = new Map;
+ let workersSeenInCurrentRecord = new Set;
let max = -Infinity;
let mainThreadMax = -Infinity;
@@ -361,8 +362,12 @@
webkitThreadAverage += webkitThreadUsage;
unknownThreadAverage += unknownThreadUsage;
+ let workersSeenInLastRecord = workersSeenInCurrentRecord;
+ workersSeenInCurrentRecord = new Set;
+
if (record.workersData && record.workersData.length) {
for (let {targetId, usage} of record.workersData) {
+ workersSeenInCurrentRecord.add(targetId);
let workerData = workersDataMap.get(targetId);
if (!workerData) {
workerData = {
@@ -402,6 +407,16 @@
workerData.average += usage;
}
}
+
+ // Close any worker that died by dropping to zero.
+ if (workersSeenInLastRecord.size) {
+ let deadWorkers = workersSeenInLastRecord.difference(workersSeenInCurrentRecord);
+ for (let workerId of deadWorkers) {
+ let workerData = workersDataMap.get(workerId);
+ if (workerData.dataPoints.lastValue.usage !== 0)
+ workerData.dataPoints.push({time, usage: 0});
+ }
+ }
}
average /= visibleRecords.length;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes