Bug 897396 - Add telemetry to Session Store for restoring a window; r=ttaubert
authorSteven MacLeod <smacleod@mozilla.com>
Tue, 30 Jul 2013 09:38:49 -0700
changeset 140517 673fab39681d530672770af21af176c891732f84
parent 140516 c9a92f76bbaae778937025963837133e0591e415
child 140518 72240998c0941cf95ed14513ee956ee4785a12b8
push id25031
push userryanvm@gmail.com
push dateTue, 30 Jul 2013 19:41:18 +0000
treeherdermozilla-central@72240998c094 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs897396
milestone25.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 897396 - Add telemetry to Session Store for restoring a window; r=ttaubert
browser/components/sessionstore/src/SessionStore.jsm
toolkit/components/telemetry/Histograms.json
--- a/browser/components/sessionstore/src/SessionStore.jsm
+++ b/browser/components/sessionstore/src/SessionStore.jsm
@@ -2776,16 +2776,18 @@ let SessionStoreInternal = {
       }
     }
     catch (ex) { // invalid state object - don't restore anything
       debug(ex);
       this._sendRestoreCompletedNotifications();
       return;
     }
 
+    TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
+
     // We're not returning from this before we end up calling restoreHistoryPrecursor
     // for this window, so make sure we send the SSWindowStateBusy event.
     this._setWindowStateBusy(aWindow);
 
     if (root._closedWindows)
       this._closedWindows = root._closedWindows;
 
     var winData;
@@ -2928,16 +2930,18 @@ let SessionStoreInternal = {
 
     if (aState.scratchpads) {
       ScratchpadManager.restoreSession(aState.scratchpads);
     }
 
     // set smoothScroll back to the original value
     tabstrip.smoothScroll = smoothScroll;
 
+    TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
+
     this._sendRestoreCompletedNotifications();
   },
 
   /**
    * Sets the tabs restoring order with the following priority:
    * Selected tab, pinned tabs, optimized visible tabs, other visible tabs and
    * hidden tabs.
    * @param aTabBrowser
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -2540,16 +2540,23 @@
   },
   "FX_SESSION_RESTORE_BACKUP_FILE_MS": {
     "kind": "exponential",
     "high": "30000",
     "n_buckets": 10,
     "extended_statistics_ok": true,
     "description": "Session restore: Time to make a backup copy of the session file (ms)"
   },
+  "FX_SESSION_RESTORE_RESTORE_WINDOW_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "extended_statistics_ok": true,
+    "description": "Session restore: Time spent blocking the main thread while restoring a window state (ms)"
+  },
   "INNERWINDOWS_WITH_MUTATION_LISTENERS": {
     "kind": "boolean",
     "description": "Deleted or to-be-reused innerwindow which has had mutation event listeners."
   },
   "CHARSET_OVERRIDE_SITUATION": {
     "kind": "enumerated",
     "n_values": 7,
     "description": "Labeling status of top-level page when overriding charset (unlabeled file URL without detection, unlabeled non-file URL without detection, unlabeled file URL with detection, unlabeled non-file URL with detection, labeled, already overridden, bug)"