Bug 1324051 - Add highlights histogram telemetry r?grisha draft
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 16 Dec 2016 10:42:04 -0800
changeset 450477 77e25d050521a51ab9993b023bad2de975300c5b
parent 450476 19b9c4197d70a3617ff8872fab36086f4d6d3d2c
child 539762 4777ceb2561e5bca9fdf824b2aa1d2b6a256bb74
push id38867
push userahunt@mozilla.com
push dateFri, 16 Dec 2016 18:43:43 +0000
reviewersgrisha
bugs1324051
milestone53.0a1
Bug 1324051 - Add highlights histogram telemetry r?grisha MozReview-Commit-ID: 92m8jYS8b8D
mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
toolkit/components/telemetry/Histograms.json
--- a/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
@@ -105,16 +105,17 @@ public class LocalBrowserDB extends Brow
     private volatile SuggestedSites mSuggestedSites;
 
     // Constants used when importing history data from legacy browser.
     public static final String HISTORY_VISITS_DATE = "date";
     public static final String HISTORY_VISITS_COUNT = "visits";
     public static final String HISTORY_VISITS_URL = "url";
 
     private static final String TELEMETRY_HISTOGRAM_ACTIVITY_STREAM_TOPSITES = "FENNEC_ACTIVITY_STREAM_TOPSITES_LOADER_TIME_MS";
+    private static final String TELEMETRY_HISTOGRAM_ACTIVITY_STREAM_HIGHLIGHTS = "FENNEC_ACTIVITY_STREAM_HIGHLIGHTS_LOADER_TIME_MS";
 
     private final Uri mBookmarksUriWithProfile;
     private final Uri mParentsUriWithProfile;
     private final Uri mHistoryUriWithProfile;
     private final Uri mHistoryExpireUriWithProfile;
     private final Uri mCombinedUriWithProfile;
     private final Uri mUpdateHistoryUriWithProfile;
     private final Uri mFaviconsUriWithProfile;
@@ -1920,17 +1921,18 @@ public class LocalBrowserDB extends Brow
     }
 
     @Override
     public CursorLoader getHighlights(Context context, int limit) {
         final Uri uri = mHighlightsUriWithProfile.buildUpon()
                 .appendQueryParameter(BrowserContract.PARAM_LIMIT, String.valueOf(limit))
                 .build();
 
-        return new CursorLoader(context, uri, null, null, null, null);
+        return new TelemetrisedCursorLoader(context, uri, null, null, null, null,
+                TELEMETRY_HISTOGRAM_ACTIVITY_STREAM_HIGHLIGHTS);
     }
 
     @Override
     public void blockActivityStreamSite(ContentResolver cr, String url) {
         final ContentValues values = new ContentValues();
         values.put(ActivityStreamBlocklist.URL, url);
         cr.insert(mActivityStreamBlockedUriWithProfile, values);
     }
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -6295,16 +6295,27 @@
     "low": 10,
     "high": 20000,
     "n_buckets": 20,
     "description": "Time for the Activity Stream home screen Top Sites query to return (ms)",
     "alert_emails": ["mobile-frontend@mozilla.com"],
     "bug_numbers": [1293790],
     "cpp_guard": "ANDROID"
   },
+  "FENNEC_ACTIVITY_STREAM_HIGHLIGHTS_LOADER_TIME_MS": {
+    "expires_in_version": "never",
+    "kind": "exponential",
+    "low": 10,
+    "high": 20000,
+    "n_buckets": 20,
+    "description": "Time for the Activity Stream highlights query to return (ms)",
+    "alert_emails": ["mobile-frontend@mozilla.com"],
+    "bug_numbers": [1298786],
+    "cpp_guard": "ANDROID"
+  },
   "FENNEC_HOMEPANELS_CUSTOM": {
     "expires_in_version": "54",
     "kind": "boolean",
     "bug_numbers": [1245368],
     "description": "Whether the user has customized their homepanels",
     "cpp_guard": "ANDROID"
   },
   "FENNEC_WAS_KILLED": {