Bug 836912 - Measure Jank in Session Restore collection and serialization. r=ttaubert
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Tue, 05 Feb 2013 11:40:48 -0500
changeset 120879 f33c5e1c1d583d42fe7ee28d5a94a140d765db41
parent 120878 45648727f6e2039e9e4f4da2c7ed24375a127c92
child 120880 b757198a3ba3ee841a64477acff843fbb5c44d81
push id24267
push userryanvm@gmail.com
push dateWed, 06 Feb 2013 00:24:04 +0000
treeherdermozilla-central@8ac096b24cb0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs836912
milestone21.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 836912 - Measure Jank in Session Restore collection and serialization. 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
@@ -3608,20 +3608,22 @@ let SessionStoreInternal = {
    *        Bool update all windows
    */
   saveState: function ssi_saveState(aUpdateAll) {
     // If crash recovery is disabled, we only want to resume with pinned tabs
     // if we crash.
     let pinnedOnly = this._loadState == STATE_RUNNING && !this._resume_from_crash;
 
     TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_DATA_MS");
+    TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_DATA_LONGEST_OP_MS");
 
     var oState = this._getCurrentState(aUpdateAll, pinnedOnly);
     if (!oState) {
       TelemetryStopwatch.cancel("FX_SESSION_RESTORE_COLLECT_DATA_MS");
+      TelemetryStopwatch.cancel("FX_SESSION_RESTORE_COLLECT_DATA_LONGEST_OP_MS");
       return;
     }
 
     // Forget about private windows.
     for (let i = oState.windows.length - 1; i >= 0; i--) {
       if (oState.windows[i].isPrivate) {
         oState.windows.splice(i, 1);
         if (oState.selectedWindow >= i) {
@@ -3665,27 +3667,30 @@ let SessionStoreInternal = {
       }
     }
 
     // Persist the last session if we deferred restoring it
     if (this._lastSessionState)
       oState.lastSessionState = this._lastSessionState;
 
     TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_DATA_MS");
+    TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_DATA_LONGEST_OP_MS");
 
     this._saveStateObject(oState);
   },
 
   /**
    * write a state object to disk
    */
   _saveStateObject: function ssi_saveStateObject(aStateObj) {
     TelemetryStopwatch.start("FX_SESSION_RESTORE_SERIALIZE_DATA_MS");
+    TelemetryStopwatch.start("FX_SESSION_RESTORE_SERIALIZE_DATA_LONGEST_OP_MS");
     let data = this._toJSONString(aStateObj);
     TelemetryStopwatch.finish("FX_SESSION_RESTORE_SERIALIZE_DATA_MS");
+    TelemetryStopwatch.finish("FX_SESSION_RESTORE_SERIALIZE_DATA_LONGEST_OP_MS");
 
     let stateString = this._createSupportsString(data);
     Services.obs.notifyObservers(stateString, "sessionstore-state-write", "");
     data = stateString.data;
 
     // Don't touch the file if an observer has deleted all state data.
     if (!data) {
       return;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -2137,22 +2137,34 @@
     "description": "Widget: Time it takes for the message before a UI message (ms)"
   },
   "FX_SESSION_RESTORE_COLLECT_DATA_MS": {
     "kind": "exponential",
     "high": "30000",
     "n_buckets": 10,
     "description": "Session restore: Time to collect all window and tab data (ms)"
   },
+  "FX_SESSION_RESTORE_COLLECT_DATA_LONGEST_OP_MS": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "Session restore: Duration of the longest uninterruptible operation while collecting all window and tab data (ms)"
+  },
   "FX_SESSION_RESTORE_SERIALIZE_DATA_MS": {
     "kind": "exponential",
     "high": "1000",
     "n_buckets": 10,
     "description": "Session restore: Time to JSON serialize session data (ms)"
   },
+  "FX_SESSION_RESTORE_SERIALIZE_DATA_LONGEST_OP_MS": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "Session restore: Duration of the longest uninterruptible operation while serializing session data (ms)"
+  },
   "FX_SESSION_RESTORE_READ_FILE_MS": {
     "kind": "exponential",
     "high": "3000",
     "n_buckets": 10,
     "description": "Session restore: Time to read the session data from the file on disk (ms)"
   },
   "FX_SESSION_RESTORE_SYNC_READ_FILE_MS": {
     "kind": "exponential",