Bug 1359708 - Add a telemetry probe for Storage API features, data-r=bsmedberg, r=bsmedberg,janv
authorShawn Huang <shuang@mozilla.com>
Thu, 27 Apr 2017 19:06:54 +0800
changeset 356254 aebffbddaafcaa5481d5e481786a62f2f45039d8
parent 356253 9e6ae4133c2efe3177bb6117e734001de72cd7d6
child 356255 ef2ba5f37c0f3f092d24f84fa45fd752a71423ca
push id89872
push userkwierso@gmail.com
push dateWed, 03 May 2017 20:54:46 +0000
treeherdermozilla-inbound@d2e7cbdd9bcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, janv
bugs1359708
milestone55.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 1359708 - Add a telemetry probe for Storage API features, data-r=bsmedberg, r=bsmedberg,janv MozReview-Commit-ID: 5DpRPOFVerW
dom/quota/StorageManager.cpp
toolkit/components/telemetry/Scalars.yaml
--- a/dom/quota/StorageManager.cpp
+++ b/dom/quota/StorageManager.cpp
@@ -6,16 +6,17 @@
 
 #include "StorageManager.h"
 
 #include "mozilla/dom/PromiseWorkerProxy.h"
 #include "mozilla/dom/quota/QuotaManagerService.h"
 #include "mozilla/dom/StorageManagerBinding.h"
 #include "mozilla/dom/WorkerPrivate.h"
 #include "mozilla/ErrorResult.h"
+#include "mozilla/Telemetry.h"
 #include "nsContentPermissionHelper.h"
 #include "nsIQuotaCallbacks.h"
 #include "nsIQuotaRequests.h"
 #include "nsPIDOMWindow.h"
 
 using namespace mozilla::dom::workers;
 
 namespace mozilla {
@@ -833,26 +834,29 @@ StorageManager::Persisted(ErrorResult& a
                                        aRv);
 }
 
 already_AddRefed<Promise>
 StorageManager::Persist(ErrorResult& aRv)
 {
   MOZ_ASSERT(mOwner);
 
+  Telemetry::ScalarAdd(Telemetry::ScalarID::NAVIGATOR_STORAGE_PERSIST_COUNT, 1);
   return ExecuteOpOnMainOrWorkerThread(mOwner,
                                        RequestResolver::Type::Persist,
                                        aRv);
 }
 
 already_AddRefed<Promise>
 StorageManager::Estimate(ErrorResult& aRv)
 {
   MOZ_ASSERT(mOwner);
 
+  Telemetry::ScalarAdd(Telemetry::ScalarID::NAVIGATOR_STORAGE_ESTIMATE_COUNT,
+                       1);
   return ExecuteOpOnMainOrWorkerThread(mOwner,
                                        RequestResolver::Type::Estimate,
                                        aRv);
 }
 
 // static
 bool
 StorageManager::PrefEnabled(JSContext* aCx, JSObject* aObj)
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -588,8 +588,39 @@ devtools.copy.full.css.selector:
     description: Number of times the DevTools copy full CSS selector has been used.
     expires: "57"
     kind: uint
     notification_emails:
       - dev-developer-tools@lists.mozilla.org
     release_channel_collection: opt-out
     record_in_processes:
       - 'main'
+
+navigator.storage:
+  estimate_count:
+    bug_numbers:
+      - 1359708
+    description: >
+      Number of times navigator.storage.estimate has been used.
+    expires: "60"
+    kind: uint
+    notification_emails:
+      - shuang@mozilla.com
+      - ttung@mozilla.com
+    release_channel_collection: opt-in
+    record_in_processes:
+      - 'main'
+      - 'content'
+
+  persist_count:
+    bug_numbers:
+      - 1359708
+    description: >
+      Number of times navigator.storage.persist has been used.
+    expires: "60"
+    kind: uint
+    notification_emails:
+      - shuang@mozilla.com
+      - ttung@mozilla.com
+    release_channel_collection: opt-in
+    record_in_processes:
+      - 'main'
+      - 'content'