Bug 1531917 - Add Telemetry for bfcache hit and miss r=bdekoz,smaug
authorSean Feng <sefeng@mozilla.com>
Tue, 14 May 2019 15:27:55 +0000
changeset 532626 fd66f241a8bda8a748dfe741802a4fecf7040c10
parent 532625 e80a258b4aed3eb6599967b22a12e2b6314482d2
child 532627 9437ce7f56f17a5f38e3c64f165005845a50fc69
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdekoz, smaug
bugs1531917
milestone68.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 1531917 - Add Telemetry for bfcache hit and miss r=bdekoz,smaug Differential Revision: https://phabricator.services.mozilla.com/D30212
docshell/base/nsDocShell.cpp
toolkit/components/telemetry/Histograms.json
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9520,18 +9520,20 @@ nsresult nsDocShell::InternalLoad(nsDocS
           prevViewer->Destroy();
         }
       }
     }
     nsCOMPtr<nsISHEntry> oldEntry = mOSHE;
     bool restoring;
     rv = RestorePresentation(aLoadState->SHEntry(), &restoring);
     if (restoring) {
+      Telemetry::Accumulate(Telemetry::BFCACHE_PAGE_RESTORED, true);
       return rv;
     }
+    Telemetry::Accumulate(Telemetry::BFCACHE_PAGE_RESTORED, false);
 
     // We failed to restore the presentation, so clean up.
     // Both the old and new history entries could potentially be in
     // an inconsistent state.
     if (NS_FAILED(rv)) {
       if (oldEntry) {
         oldEntry->SyncPresentationState();
       }
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -14487,16 +14487,24 @@
       "Unload_Req_Peer",
       "Unload_Req_Peer_MSE",
       "Unload_Req_MSE",
       "SPD_Unload_Req_Peer",
       "Other"
     ],
     "description": "The common combinations of BFCacheStatus when we determine whether the page can be BFCached or not; If it uses BFCache, we record BFCache_Success; If it's not and it falls under common failure reasons combinations, we record the corresponding combination; Otherwise, we record Other to indicate this is not a common failure"
   },
+  "BFCACHE_PAGE_RESTORED": {
+    "record_in_processes": ["main", "content"],
+    "alert_emails": ["sefeng@mozilla.com"],
+    "bug_numbers": [1531917],
+    "expires_in_version": "never",
+    "kind": "boolean",
+    "description": "Whether bfcache is used when loading a page from session history"
+  },
   "HIDDEN_VIEWPORT_OVERFLOW_TYPE": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["mozilla-telemetry@upsuper.org", "botond@mozilla.com"],
     "bug_numbers": [1423013, 1423017, 1513089],
     "expires_in_version": "70",
     "kind": "categorical",
     "releaseChannelCollection": "opt-out",
     "labels": ["NoOverflow", "Desktop", "ButNotMinScaleSize", "MinScaleSize"],