Skip to content
Permalink
Browse files
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.


Canonical link: https://commits.webkit.org/211297@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JosephPecoraro committed Apr 17, 2019
1 parent e6a3924 commit 4688afcfb40826c7ba5133da2cccca626e4567de
Showing 3 changed files with 28 additions and 0 deletions.
@@ -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`.
@@ -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";
@@ -351,6 +351,11 @@ WI.CPUTimelineView = class CPUTimelineView extends WI.TimelineView
this._statisticsTable = statisticsContainerElement.appendChild(document.createElement("table"));
this._statisticsRows = [];

{
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:");
@@ -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)

0 comments on commit 4688afc

Please sign in to comment.