Bug 1601444 - fix(devtools/network-monitor): Always show server timings r=Honza
authorSorin Davidoi <sorin.davidoi@protonmail.com>
Mon, 09 Dec 2019 09:58:42 +0000
changeset 505988 395fa0c936538965886f60b870d9f20eae4e3092
parent 505987 260044e4e029d7e69f03ec80c1c006699fc115e0
child 505989 e65c1bcb013fb1d12cc3ae3b7474add9d0d52e3b
push id36895
push userccoroiu@mozilla.com
push dateMon, 09 Dec 2019 16:35:51 +0000
treeherdermozilla-central@666b11c33fee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1601444
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1601444 - fix(devtools/network-monitor): Always show server timings r=Honza Report server timings if they are sent when the transaction is closed. Differential Revision: https://phabricator.services.mozilla.com/D55867
devtools/server/actors/network-monitor/network-event.js
devtools/server/actors/network-monitor/network-observer.js
--- a/devtools/server/actors/network-monitor/network-event.js
+++ b/devtools/server/actors/network-monitor/network-event.js
@@ -35,17 +35,17 @@ const NetworkEventActor = protocol.Actor
 
     this._response = {
       headers: [],
       cookies: [],
       content: {},
     };
 
     this._timings = {};
-    this._serverTimings = {};
+    this._serverTimings = [];
     this._stackTrace = {};
 
     this._discardRequestBody = false;
     this._discardResponseBody = false;
   },
 
   _request: null,
   _response: null,
--- a/devtools/server/actors/network-monitor/network-observer.js
+++ b/devtools/server/actors/network-monitor/network-observer.js
@@ -1011,22 +1011,25 @@ NetworkObserver.prototype = {
    * timing information on the HTTP activity object and clears the request
    * from the list of known open requests.
    *
    * @private
    * @param object httpActivity
    *        The HTTP activity object we work with.
    */
   _onTransactionClose: function(httpActivity) {
-    const result = this._setupHarTimings(httpActivity);
     if (httpActivity.owner) {
+      const result = this._setupHarTimings(httpActivity);
+      const serverTimings = this._extractServerTimings(httpActivity.channel);
+
       httpActivity.owner.addEventTimings(
         result.total,
         result.timings,
-        result.offsets
+        result.offsets,
+        serverTimings
       );
     }
     this.openRequests.delete(httpActivity.channel);
   },
 
   /**
    * Update the HTTP activity object to include timing information as in the HAR
    * spec. The HTTP activity object holds the raw timing information in