Web Inspector: CPU Usage Timeline - Include # of Network Requests in the Statistics...
authorpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2019 23:37:17 +0000 (23:37 +0000)
committerpecoraro@apple.com <pecoraro@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Apr 2019 23:37:17 +0000 (23:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197039
<rdar://problem/49996299>

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.initialLayout):
(WI.CPUTimelineView.prototype._computeStatisticsData):
(WI.CPUTimelineView.prototype._clearStatistics):
Add the number of network requests started in the selected range.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244411 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Views/CPUTimelineView.js

index d79294d..9a21984 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-17  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: CPU Usage Timeline - Include # of Network Requests in the Statistics section
+        https://bugs.webkit.org/show_bug.cgi?id=197039
+        <rdar://problem/49996299>
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Views/CPUTimelineView.js:
+        (WI.CPUTimelineView.prototype.initialLayout):
+        (WI.CPUTimelineView.prototype._computeStatisticsData):
+        (WI.CPUTimelineView.prototype._clearStatistics):
+        Add the number of network requests started in the selected range.
+
 2019-04-17  Timothy Hatcher  <timothy@apple.com>
 
         Rename `supported-color-schemes` to `color-scheme`.
index b6f9bfd..c68e704 100644 (file)
@@ -664,6 +664,7 @@ localizedStrings["Name"] = "Name";
 localizedStrings["Network"] = "Network";
 localizedStrings["Network Issue"] = "Network Issue";
 localizedStrings["Network Requests"] = "Network Requests";
+localizedStrings["Network Requests:"] = "Network Requests:";
 localizedStrings["New Tab"] = "New Tab";
 localizedStrings["Next Sibling"] = "Next Sibling";
 localizedStrings["No"] = "No";
index 59e97a0..1513d4e 100644 (file)
@@ -353,6 +353,11 @@ WI.CPUTimelineView = class CPUTimelineView extends WI.TimelineView
 
         {
             let {headerCell, numberCell} = this._createTableRow(this._statisticsTable);
+            headerCell.textContent = WI.UIString("Network Requests:");
+            this._networkRequestsNumberElement = numberCell;
+        }
+        {
+            let {headerCell, numberCell} = this._createTableRow(this._statisticsTable);
             headerCell.textContent = WI.UIString("Script Entries:");
             this._scriptEntriesNumberElement = numberCell;
         }
@@ -786,6 +791,7 @@ WI.CPUTimelineView = class CPUTimelineView extends WI.TimelineView
 
         this._clearStatistics();
 
+        this._networkRequestsNumberElement.textContent = statistics.networkRequests;
         this._scriptEntriesNumberElement.textContent = statistics.scriptEntries;
 
         let createFilterElement = (type, name) => {
@@ -1265,6 +1271,10 @@ WI.CPUTimelineView = class CPUTimelineView extends WI.TimelineView
             }
         });
 
+        let networkTimeline = this._recording.timelineForRecordType(WI.TimelineRecord.Type.Network);
+        let networkRecords = networkTimeline ? networkTimeline.recordsInTimeRange(startTime, endTime) : [];
+        let networkRequests = networkRecords.length;
+
         let millisecondStartTime = Math.round(startTime * 1000);
         let millisecondEndTime = Math.round(endTime * 1000);
         let millisecondDuration = millisecondEndTime - millisecondStartTime;
@@ -1340,6 +1350,7 @@ WI.CPUTimelineView = class CPUTimelineView extends WI.TimelineView
             samplesPaint,
             samplesStyle,
             scriptEntries,
+            networkRequests,
             timerTypes,
             eventTypes,
             observerTypes,
@@ -1464,6 +1475,7 @@ WI.CPUTimelineView = class CPUTimelineView extends WI.TimelineView
 
     _clearStatistics()
     {
+        this._networkRequestsNumberElement.textContent = emDash;
         this._scriptEntriesNumberElement.textContent = emDash;
 
         for (let row of this._statisticsRows)