Bug 1246159 - Add histogram probe for disk space used by reader view cache r?mcomella draft
authorAndrzej Hunt <ahunt@mozilla.com>
Thu, 12 May 2016 13:37:58 -0700
changeset 366433 dfc0e07ffe6103073a8eecac300d1ccc4a1064b9
parent 366432 84966bcd6ff0f944ef87efb028f5b0ce7c66c5ca
child 520786 ddd13d450f2ae618d1d8a817d199feff3a2a91f3
push id17995
push userahunt@mozilla.com
push dateThu, 12 May 2016 20:41:52 +0000
reviewersmcomella
bugs1246159
milestone49.0a1
Bug 1246159 - Add histogram probe for disk space used by reader view cache r?mcomella MozReview-Commit-ID: 4r1yvWZ4lid
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
toolkit/components/telemetry/Histograms.json
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -1720,16 +1720,18 @@ public class BrowserApp extends GeckoApp
             Telemetry.addToHistogram("PLACES_PAGES_COUNT", db.getCount(cr, "history"));
             Telemetry.addToHistogram("FENNEC_BOOKMARKS_COUNT", db.getCount(cr, "bookmarks"));
             Telemetry.addToHistogram("BROWSER_IS_USER_DEFAULT", (isDefaultBrowser(Intent.ACTION_VIEW) ? 1 : 0));
             Telemetry.addToHistogram("FENNEC_CUSTOM_HOMEPAGE", (TextUtils.isEmpty(getHomepage()) ? 0 : 1));
             final SharedPreferences prefs = GeckoSharedPrefs.forProfile(getContext());
             final boolean hasCustomHomepanels = prefs.contains(HomeConfigPrefsBackend.PREFS_CONFIG_KEY) || prefs.contains(HomeConfigPrefsBackend.PREFS_CONFIG_KEY_OLD);
             Telemetry.addToHistogram("FENNEC_HOMEPANELS_CUSTOM", hasCustomHomepanels ? 1 : 0);
 
+            Telemetry.addToHistogram("FENNEC_READER_VIEW_CACHE_SIZE", SavedReaderViewHelper.getSavedReaderViewHelper(getContext()).getDiskSpacedUsedKB());
+
             if (Versions.feature16Plus) {
                 Telemetry.addToHistogram("BROWSER_IS_ASSIST_DEFAULT", (isDefaultBrowser(Intent.ACTION_ASSIST) ? 1 : 0));
             }
 
             if (Restrictions.isRestrictedProfile(this)) {
                 for (Restrictable rest : RestrictedProfileConfiguration.getVisibleRestrictions()) {
                     int value = Restrictions.isAllowed(this, rest) ? 1 : 0;
                     Telemetry.addToKeyedHistogram("FENNEC_RESTRICTED_PROFILE_RESTRICTIONS", rest.name(), value);
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3625,16 +3625,25 @@
   "FENNEC_READING_LIST_COUNT": {
     "expires_in_version": "50",
     "kind": "exponential",
     "high": 1000,
     "n_buckets": 10,
     "cpp_guard": "ANDROID",
     "description": "Number of reading list items stored in the browser DB *** No longer needed (bug 1156565). Delete histogram and accumulation code! ***"
   },
+  "FENNEC_READER_VIEW_CACHE_SIZE": {
+    "expires_in_version": "60",
+    "alert_emails": ["mobile-frontend@mozilla.com"],
+    "kind": "exponential",
+    "high": 50000,
+    "n_buckets": 20,
+    "description": "Total disk space used by items in the reader view cache, in KB.",
+    "bug_numbers": [1246159]
+  },
   "PLACES_SORTED_BOOKMARKS_PERC": {
     "expires_in_version": "never",
     "kind": "linear",
     "high": 100,
     "n_buckets": 10,
     "description": "PLACES: Percentage of bookmarks organized in folders"
   },
   "PLACES_TAGGED_BOOKMARKS_PERC": {