Bug 1093871 - Telemetry probe for number of items in reading list. r=rnewman, a=lmandel
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 07 Nov 2014 15:35:12 -0800
changeset 226014 f85f63d11f68
parent 226013 9ebc7ee50a9c
child 226015 fa1706ebf845
push id4105
push userryanvm@gmail.com
push date2014-11-10 18:36 +0000
treeherdermozilla-beta@fa1706ebf845 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, lmandel
bugs1093871
milestone34.0
Bug 1093871 - Telemetry probe for number of items in reading list. r=rnewman, a=lmandel
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
@@ -1379,16 +1379,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() ? 1 : 0));
         } else if ("Updater:Launch".equals(event)) {
             handleUpdaterLaunch();
 
         } else if ("BrowserToolbar:Visibility".equals(event)) {
             setBrowserToolbarVisible(message.getBoolean("visible"));
 
         } else {
--- a/mobile/android/base/db/LocalBrowserDB.java
+++ b/mobile/android/base/db/LocalBrowserDB.java
@@ -544,16 +544,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) {
             Cursor cursor = null;
 
             try {
                 cursor = cr.query(uri, columns, constraint, null, null);
                 count = cursor.getCount();
             } finally {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3117,16 +3117,25 @@
     "expires_in_version": "never",
     "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": {