Bug 1601444 - fix(devtools/network-monitor): Always show server timings r=Honza a=jcristau
authorSorin Davidoi <sorin.davidoi@protonmail.com>
Mon, 09 Dec 2019 09:58:42 +0000
changeset 566761 0ca0daf7cd8d4fc62fca57b8afb152c42aab4d5d
parent 566760 ac6e049005c41f448cc30e86e1a0719dd08c11f1
child 566762 65814de6f44958b4974ce42c08fe6d74d43ac9e7
push id12400
push usernerli@mozilla.com
push dateTue, 10 Dec 2019 16:08:08 +0000
treeherdermozilla-beta@862f48c75333 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza, jcristau
bugs1601444
milestone72.0
Bug 1601444 - fix(devtools/network-monitor): Always show server timings r=Honza a=jcristau 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