Bug 1093871 - Telemetry probe for number of items in reading list. r=rnewman
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 07 Nov 2014 15:35:12 -0800
changeset 226221 986d09aa774941506ff4c32ca56fe9e63966198f
parent 226220 1b2470364d5897515cc8b2fc35b31e493a54aa73
child 226222 3f54cbf8e85bf623eb7b00332e298a27cee33e38
push id36
push userdburns@mozilla.com
push dateMon, 10 Nov 2014 15:14:02 +0000
reviewersrnewman
bugs1093871
milestone36.0a1
Bug 1093871 - Telemetry probe for number of items in reading list. r=rnewman
mobile/android/base/BrowserApp.java
mobile/android/base/db/LocalBrowserDB.java
toolkit/components/telemetry/Histograms.json
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1544,16 +1544,18 @@ public class BrowserApp extends GeckoApp
             Telemetry.HistogramAdd("PLACES_PAGES_COUNT",
                     BrowserDB.getCount(getContentResolver(), "history"));
             Telemetry.HistogramAdd("PLACES_BOOKMARKS_COUNT",
                     BrowserDB.getCount(getContentResolver(), "bookmarks"));
             Telemetry.HistogramAdd("FENNEC_FAVICONS_COUNT",
                     BrowserDB.getCount(getContentResolver(), "favicons"));
             Telemetry.HistogramAdd("FENNEC_THUMBNAILS_COUNT",
                     BrowserDB.getCount(getContentResolver(), "thumbnails"));
+            Telemetry.HistogramAdd("FENNEC_READING_LIST_COUNT",
+                    BrowserDB.getCount(getContentResolver(), "readinglist"));
             Telemetry.HistogramAdd("BROWSER_IS_USER_DEFAULT", (isDefaultBrowser(Intent.ACTION_VIEW) ? 1 : 0));
             if (Versions.feature16Plus) {
                 Telemetry.HistogramAdd("BROWSER_IS_ASSIST_DEFAULT", (isDefaultBrowser(Intent.ACTION_ASSIST) ? 1 : 0));
             }
         } else if ("Updater:Launch".equals(event)) {
             handleUpdaterLaunch();
 
         } else if ("BrowserToolbar:Visibility".equals(event)) {
--- a/mobile/android/base/db/LocalBrowserDB.java
+++ b/mobile/android/base/db/LocalBrowserDB.java
@@ -547,16 +547,19 @@ public class LocalBrowserDB {
             // ignore folders, tags, keywords, separators, etc.
             constraint = Bookmarks.TYPE + " = " + Bookmarks.TYPE_BOOKMARK;
         } else if ("thumbnails".equals(database)) {
             uri = mThumbnailsUriWithProfile;
             columns = new String[] { Thumbnails._ID };
         } else if ("favicons".equals(database)) {
             uri = mFaviconsUriWithProfile;
             columns = new String[] { Favicons._ID };
+        } else if ("readinglist".equals(database)) {
+            uri = mReadingListUriWithProfile;
+            columns = new String[] { ReadingListItems._ID };
         }
         if (uri != null) {
             final Cursor cursor = cr.query(uri, columns, constraint, null, null);
 
             try {
                 count = cursor.getCount();
             } finally {
                 cursor.close();
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3172,16 +3172,25 @@
     "expires_in_version": "40",
     "kind": "exponential",
     "high": "2000",
     "n_buckets": 10,
     "cpp_guard": "ANDROID",
     "extended_statistics_ok": true,
     "description": "Number of thumbnails stored in the browser DB"
   },
+  "FENNEC_READING_LIST_COUNT": {
+    "expires_in_version": "40",
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 10,
+    "cpp_guard": "ANDROID",
+    "extended_statistics_ok": true,
+    "description": "Number of reading list items stored in the browser DB"
+  },
   "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": {