Bug 1115075 - Part 0: rename HistogramAdd -> addToHistogram. r=mfinkle
authorRichard Newman <rnewman@mozilla.com>
Tue, 23 Dec 2014 12:58:28 -0800
changeset 221191 8c93e281718e2ac8bdd01ba913ac26f2a84925cb
parent 221190 78614247a0b38e7e55e6e725f769a59eff71dba1
child 221192 6441c30a1317a3a5f20d0011a826168ba127503d
push id28013
push userphilringnalda@gmail.com
push dateWed, 24 Dec 2014 23:31:28 +0000
treeherdermozilla-central@38471b0310c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1115075
milestone37.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 1115075 - Part 0: rename HistogramAdd -> addToHistogram. r=mfinkle
mobile/android/base/BrowserApp.java
mobile/android/base/GeckoApp.java
mobile/android/base/GlobalHistory.java
mobile/android/base/Telemetry.java
mobile/android/base/db/SQLiteBridgeContentProvider.java
mobile/android/base/db/URLMetadata.java
mobile/android/base/distribution/Distribution.java
mobile/android/base/home/SearchLoader.java
mobile/android/base/home/TopSitesPanel.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -1524,29 +1524,29 @@ public class BrowserApp extends GeckoApp
 
             // Don't use a transition to settings if we're on a device where that
             // would look bad.
             if (HardwareUtils.IS_KINDLE_DEVICE) {
                 overridePendingTransition(0, 0);
             }
 
         } else if ("Telemetry:Gather".equals(event)) {
-            Telemetry.HistogramAdd("PLACES_PAGES_COUNT",
+            Telemetry.addToHistogram("PLACES_PAGES_COUNT",
                     BrowserDB.getCount(getContentResolver(), "history"));
-            Telemetry.HistogramAdd("PLACES_BOOKMARKS_COUNT",
+            Telemetry.addToHistogram("PLACES_BOOKMARKS_COUNT",
                     BrowserDB.getCount(getContentResolver(), "bookmarks"));
-            Telemetry.HistogramAdd("FENNEC_FAVICONS_COUNT",
+            Telemetry.addToHistogram("FENNEC_FAVICONS_COUNT",
                     BrowserDB.getCount(getContentResolver(), "favicons"));
-            Telemetry.HistogramAdd("FENNEC_THUMBNAILS_COUNT",
+            Telemetry.addToHistogram("FENNEC_THUMBNAILS_COUNT",
                     BrowserDB.getCount(getContentResolver(), "thumbnails"));
-            Telemetry.HistogramAdd("FENNEC_READING_LIST_COUNT",
+            Telemetry.addToHistogram("FENNEC_READING_LIST_COUNT",
                     BrowserDB.getCount(getContentResolver(), "readinglist"));
-            Telemetry.HistogramAdd("BROWSER_IS_USER_DEFAULT", (isDefaultBrowser(Intent.ACTION_VIEW) ? 1 : 0));
+            Telemetry.addToHistogram("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));
+                Telemetry.addToHistogram("BROWSER_IS_ASSIST_DEFAULT", (isDefaultBrowser(Intent.ACTION_ASSIST) ? 1 : 0));
             }
         } else if ("Updater:Launch".equals(event)) {
             handleUpdaterLaunch();
 
         } else if ("BrowserToolbar:Visibility".equals(event)) {
             setBrowserToolbarVisible(message.getBoolean("visible"));
 
         } else {
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1221,17 +1221,17 @@ public abstract class GeckoApp
             GeckoAppShell.systemExit();
             return;
         }
 
         if (GeckoThread.isCreated()) {
             // This happens when the GeckoApp activity is destroyed by Android
             // without killing the entire application (see Bug 769269).
             mIsRestoringActivity = true;
-            Telemetry.HistogramAdd("FENNEC_RESTORING_ACTIVITY", 1);
+            Telemetry.addToHistogram("FENNEC_RESTORING_ACTIVITY", 1);
 
         } else {
             final String uri = getURIFromIntent(intent);
 
             GeckoThread.setArgs(args);
             GeckoThread.setAction(action);
             GeckoThread.setUri(TextUtils.isEmpty(uri) ? null : uri);
         }
@@ -1284,17 +1284,17 @@ public abstract class GeckoApp
         mShouldRestore = getSessionRestoreState(savedInstanceState);
         if (mShouldRestore && savedInstanceState != null) {
             boolean wasInBackground =
                 savedInstanceState.getBoolean(SAVED_STATE_IN_BACKGROUND, false);
 
             // Don't log OOM-kills if only one activity was destroyed. (For example
             // from "Don't keep activities" on ICS)
             if (!wasInBackground && !mIsRestoringActivity) {
-                Telemetry.HistogramAdd("FENNEC_WAS_KILLED", 1);
+                Telemetry.addToHistogram("FENNEC_WAS_KILLED", 1);
             }
 
             mPrivateBrowsingSession = savedInstanceState.getString(SAVED_STATE_PRIVATE_SESSION);
         }
 
         // Perform background initialization.
         ThreadUtils.postToBackgroundThread(new Runnable() {
             @Override
@@ -1303,17 +1303,17 @@ public abstract class GeckoApp
 
                 // Wait until now to set this, because we'd rather throw an exception than
                 // have a caller of BrowserLocaleManager regress startup.
                 final LocaleManager localeManager = BrowserLocaleManager.getInstance();
                 localeManager.initialize(getApplicationContext());
 
                 SessionInformation previousSession = SessionInformation.fromSharedPrefs(prefs);
                 if (previousSession.wasKilled()) {
-                    Telemetry.HistogramAdd("FENNEC_WAS_KILLED", 1);
+                    Telemetry.addToHistogram("FENNEC_WAS_KILLED", 1);
                 }
 
                 SharedPreferences.Editor editor = prefs.edit();
                 editor.putBoolean(GeckoApp.PREFS_OOM_EXCEPTION, false);
 
                 // Put a flag to check if we got a normal `onSaveInstanceState`
                 // on exit, or if we were suddenly killed (crash or native OOM).
                 editor.putBoolean(GeckoApp.PREFS_WAS_STOPPED, false);
@@ -1526,17 +1526,17 @@ public abstract class GeckoApp
         }
 
         // If we're not restoring, move the session file so it can be read for
         // the last tabs section.
         if (!mShouldRestore) {
             getProfile().moveSessionFile();
         }
 
-        Telemetry.HistogramAdd("FENNEC_STARTUP_GECKOAPP_ACTION", startupAction.ordinal());
+        Telemetry.addToHistogram("FENNEC_STARTUP_GECKOAPP_ACTION", startupAction.ordinal());
 
         // Check if launched from data reporting notification.
         if (ACTION_LAUNCH_SETTINGS.equals(action)) {
             Intent settingsIntent = new Intent(GeckoApp.this, GeckoPreferences.class);
             // Copy extras.
             settingsIntent.putExtras(intent.getUnsafe());
             startActivity(settingsIntent);
         }
--- a/mobile/android/base/GlobalHistory.java
+++ b/mobile/android/base/GlobalHistory.java
@@ -65,17 +65,17 @@ class GlobalHistory {
                         if (c.moveToFirst()) {
                             do {
                                 visitedSet.add(c.getString(0));
                             } while (c.moveToNext());
                         }
                         mVisitedCache = new SoftReference<Set<String>>(visitedSet);
                         final long end = SystemClock.uptimeMillis();
                         final long took = end - start;
-                        Telemetry.HistogramAdd(TELEMETRY_HISTOGRAM_BUILD_VISITED_LINK, (int) Math.min(took, Integer.MAX_VALUE));
+                        Telemetry.addToHistogram(TELEMETRY_HISTOGRAM_BUILD_VISITED_LINK, (int) Math.min(took, Integer.MAX_VALUE));
                     } finally {
                         c.close();
                     }
                 }
 
                 // This runs on the same handler thread as the checkUriVisited code,
                 // so no synchronization is needed.
                 while (true) {
@@ -101,27 +101,27 @@ class GlobalHistory {
         GeckoAppShell.notifyUriVisited(uri);
     }
 
     public void add(String uri) {
         final long start = SystemClock.uptimeMillis();
         BrowserDB.updateVisitedHistory(GeckoAppShell.getContext().getContentResolver(), uri);
         final long end = SystemClock.uptimeMillis();
         final long took = end - start;
-        Telemetry.HistogramAdd(TELEMETRY_HISTOGRAM_ADD, (int) Math.min(took, Integer.MAX_VALUE));
+        Telemetry.addToHistogram(TELEMETRY_HISTOGRAM_ADD, (int) Math.min(took, Integer.MAX_VALUE));
         addToGeckoOnly(uri);
     }
 
     @SuppressWarnings("static-method")
     public void update(String uri, String title) {
         final long start = SystemClock.uptimeMillis();
         BrowserDB.updateHistoryTitle(GeckoAppShell.getContext().getContentResolver(), uri, title);
         final long end = SystemClock.uptimeMillis();
         final long took = end - start;
-        Telemetry.HistogramAdd(TELEMETRY_HISTOGRAM_UPDATE, (int) Math.min(took, Integer.MAX_VALUE));
+        Telemetry.addToHistogram(TELEMETRY_HISTOGRAM_UPDATE, (int) Math.min(took, Integer.MAX_VALUE));
     }
 
     public void checkUriVisited(final String uri) {
         mHandler.post(new Runnable() {
             @Override
             public void run() {
                 // this runs on the same handler thread as the processing loop,
                 // so no synchronization needed
--- a/mobile/android/base/Telemetry.java
+++ b/mobile/android/base/Telemetry.java
@@ -33,17 +33,17 @@ public class Telemetry {
     }
 
     public static long realtime() {
         return SystemClock.elapsedRealtime();
     }
 
     // Define new histograms in:
     // toolkit/components/telemetry/Histograms.json
-    public static void HistogramAdd(String name, int value) {
+    public static void addToHistogram(String name, int value) {
         GeckoEvent event = GeckoEvent.createTelemetryHistogramAddEvent(name, value);
         GeckoAppShell.sendEventToGecko(event);
     }
 
     public abstract static class Timer {
         private final long mStartTime;
         private final String mName;
 
@@ -80,17 +80,17 @@ public class Telemetry {
             }
 
             mElapsed = elapsed;
             if (elapsed > Integer.MAX_VALUE) {
                 Log.e(LOGTAG, "Duration of " + elapsed + "ms is too great to add to histogram.");
                 return;
             }
 
-            HistogramAdd(mName, (int)(elapsed));
+            addToHistogram(mName, (int) (elapsed));
         }
     }
 
     public static class RealtimeTimer extends Timer {
         public RealtimeTimer(String name) {
             super(name);
         }
 
--- a/mobile/android/base/db/SQLiteBridgeContentProvider.java
+++ b/mobile/android/base/db/SQLiteBridgeContentProvider.java
@@ -441,17 +441,17 @@ public abstract class SQLiteBridgeConten
 
     protected void reportError(SQLiteBridgeException e, TelemetryErrorOp op) {
         Log.e(mLogTag, "Error in database " + op.name(), e);
         final String histogram = getHistogram(e);
         if (histogram == null) {
             return;
         }
 
-        Telemetry.HistogramAdd(histogram, op.getBucket());
+        Telemetry.addToHistogram(histogram, op.getBucket());
     }
 
     protected abstract String getDBName();
 
     protected abstract int getDBVersion();
 
     protected abstract String getTable(Uri uri);
 
--- a/mobile/android/base/db/URLMetadata.java
+++ b/mobile/android/base/db/URLMetadata.java
@@ -5,23 +5,21 @@
  */
 package org.mozilla.gecko.db;
 
 import org.mozilla.gecko.db.BrowserContract.Bookmarks;
 import org.mozilla.gecko.db.BrowserContract.History;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.Telemetry;
 
-import org.json.JSONException;
 import org.json.JSONObject;
 
 import android.content.ContentValues;
 import android.content.ContentResolver;
 import android.database.Cursor;
-import android.database.sqlite.SQLiteDatabase;
 import android.net.Uri;
 import android.support.v4.util.LruCache;
 import android.text.TextUtils;
 import android.util.Log;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -114,17 +112,17 @@ public class URLMetadata {
             if (hit != null) {
                 // Cache hit!
                 data.put(url, hit);
             } else {
                 urlsToQuery.add(url);
             }
         }
 
-        Telemetry.HistogramAdd("FENNEC_TILES_CACHE_HIT", data.size());
+        Telemetry.addToHistogram("FENNEC_TILES_CACHE_HIT", data.size());
 
         // If everything was in the cache, we're done!
         if (urlsToQuery.size() == 0) {
             return Collections.unmodifiableMap(data);
         }
 
         final String selection = DBUtils.computeSQLInClause(urlsToQuery.size(), URLMetadataTable.URL_COLUMN);
         // We need the url to build our final HashMap, so we force it to be included in the query.
--- a/mobile/android/base/distribution/Distribution.java
+++ b/mobile/android/base/distribution/Distribution.java
@@ -294,41 +294,41 @@ public class Distribution {
                 Log.e(LOGTAG, "Distribution preferences.json has no Global entry!");
                 return null;
             }
 
             return new DistributionDescriptor(all.getJSONObject("Global"));
 
         } catch (IOException e) {
             Log.e(LOGTAG, "Error getting distribution descriptor file.", e);
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
             return null;
         } catch (JSONException e) {
             Log.e(LOGTAG, "Error parsing preferences.json", e);
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
             return null;
         }
     }
 
     public JSONArray getBookmarks() {
         File bookmarks = getDistributionFile("bookmarks.json");
         if (bookmarks == null) {
             // Logging and existence checks are handled in getDistributionFile.
             return null;
         }
 
         try {
             return new JSONArray(FileUtils.getFileContents(bookmarks));
         } catch (IOException e) {
             Log.e(LOGTAG, "Error getting bookmarks", e);
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
             return null;
         } catch (JSONException e) {
             Log.e(LOGTAG, "Error parsing bookmarks.json", e);
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_MALFORMED_DISTRIBUTION);
             return null;
         }
     }
 
     /**
      * Don't call from the main thread.
      *
      * Postcondition: if this returns true, distributionDir will have been
@@ -421,17 +421,17 @@ public class Distribution {
                     Log.e(LOGTAG, "Error fetching distribution from network.", e);
                     recordFetchTelemetry(e);
                     return false;
                 }
 
                 long end = SystemClock.uptimeMillis();
                 final long duration = end - start;
                 Log.d(LOGTAG, "Distro fetch took " + duration + "ms; result? " + (distro != null));
-                Telemetry.HistogramAdd(HISTOGRAM_DOWNLOAD_TIME_MS, clamp(MAX_DOWNLOAD_TIME_MSEC, duration));
+                Telemetry.addToHistogram(HISTOGRAM_DOWNLOAD_TIME_MS, clamp(MAX_DOWNLOAD_TIME_MSEC, duration));
 
                 if (distro == null) {
                     // Nothing to do.
                     return false;
                 }
 
                 // Try to copy distribution files from the fetched stream.
                 try {
@@ -440,20 +440,20 @@ public class Distribution {
                         // We always copy to the data dir, and we only copy files from
                         // a 'distribution' subdirectory. Track our dist dir now that
                         // we know it.
                         this.distributionDir = new File(getDataDir(), DISTRIBUTION_PATH);
                         return true;
                     }
                 } catch (SecurityException e) {
                     Log.e(LOGTAG, "Security exception copying files. Corrupt or malicious?", e);
-                    Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_POST_FETCH_SECURITY_EXCEPTION);
+                    Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_POST_FETCH_SECURITY_EXCEPTION);
                 } catch (Exception e) {
                     Log.e(LOGTAG, "Error copying files from distribution.", e);
-                    Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_POST_FETCH_EXCEPTION);
+                    Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_POST_FETCH_EXCEPTION);
                 } finally {
                     distro.close();
                 }
             } finally {
                 connection.disconnect();
             }
         } catch (IOException e) {
             Log.e(LOGTAG, "Error copying distribution files from network.", e);
@@ -485,59 +485,59 @@ public class Distribution {
         final int value;
         if (status > 599 || status < 100) {
             Log.wtf(LOGTAG, "Unexpected HTTP status code: " + status);
             value = CODE_CATEGORY_STATUS_OUT_OF_RANGE;
         } else {
             value = status / 100;
         }
         
-        Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, value);
+        Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, value);
 
         if (status != 200) {
             Log.w(LOGTAG, "Got status " + status + " fetching distribution.");
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_NON_SUCCESS_RESPONSE);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_NON_SUCCESS_RESPONSE);
             return null;
         }
 
         final String contentType = connection.getContentType();
         if (contentType == null || !contentType.startsWith(EXPECTED_CONTENT_TYPE)) {
             Log.w(LOGTAG, "Malformed response: invalid Content-Type.");
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_INVALID_CONTENT_TYPE);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_INVALID_CONTENT_TYPE);
             return null;
         }
 
         return new JarInputStream(new BufferedInputStream(connection.getInputStream()), true);
     }
 
     private static void recordFetchTelemetry(final Exception exception) {
         if (exception == null) {
             // Should never happen.
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_EXCEPTION);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_EXCEPTION);
             return;
         }
 
         if (exception instanceof UnknownHostException) {
             // Unknown host => we're offline.
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_OFFLINE);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_OFFLINE);
             return;
         }
 
         if (exception instanceof SSLException) {
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_SSL_ERROR);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_SSL_ERROR);
             return;
         }
 
         if (exception instanceof ProtocolException ||
             exception instanceof SocketException) {
-            Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_SOCKET_ERROR);
+            Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_SOCKET_ERROR);
             return;
         }
 
-        Telemetry.HistogramAdd(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_EXCEPTION);
+        Telemetry.addToHistogram(HISTOGRAM_CODE_CATEGORY, CODE_CATEGORY_FETCH_EXCEPTION);
     }
 
     /**
      * Execute tasks that wanted to run when we were done loading
      * the distribution. These tasks are expected to call {@link #exists()}
      * to find out whether there's a distribution or not.
      */
     private void runReadyQueue() {
@@ -702,17 +702,17 @@ public class Distribution {
         if (content == null) {
             return null;
         }
 
         // We restrict here to avoid injection attacks. After all,
         // we're downloading a distribution payload based on intent input.
         if (!content.matches("^[a-zA-Z0-9]+$")) {
             Log.e(LOGTAG, "Invalid referrer content: " + content);
-            Telemetry.HistogramAdd(HISTOGRAM_REFERRER_INVALID, 1);
+            Telemetry.addToHistogram(HISTOGRAM_REFERRER_INVALID, 1);
             return null;
         }
 
         try {
             return new URI(FETCH_PROTOCOL, FETCH_HOSTNAME, FETCH_PATH + content + FETCH_EXTENSION, null);
         } catch (URISyntaxException e) {
             // This should never occur.
             Log.wtf(LOGTAG, "Invalid URI with content " + content + "!");
--- a/mobile/android/base/home/SearchLoader.java
+++ b/mobile/android/base/home/SearchLoader.java
@@ -13,17 +13,16 @@ import org.mozilla.gecko.db.BrowserDB.Fi
 
 import android.content.Context;
 import android.database.Cursor;
 import android.os.Bundle;
 import android.os.SystemClock;
 import android.support.v4.app.LoaderManager;
 import android.support.v4.app.LoaderManager.LoaderCallbacks;
 import android.support.v4.content.Loader;
-import android.util.Log;
 
 /**
  * Encapsulates the implementation of the search cursor loader.
  */
 class SearchLoader {
     public static final String LOGTAG = "GeckoSearchLoader";
 
     private static final String KEY_SEARCH_TERM = "search_term";
@@ -95,17 +94,17 @@ class SearchLoader {
         }
 
         @Override
         public Cursor loadCursor() {
             final long start = SystemClock.uptimeMillis();
             final Cursor cursor = BrowserDB.filter(getContext().getContentResolver(), mSearchTerm, SEARCH_LIMIT, mFlags);
             final long end = SystemClock.uptimeMillis();
             final long took = end - start;
-            Telemetry.HistogramAdd(TELEMETRY_HISTOGRAM_LOAD_CURSOR, (int) Math.min(took, Integer.MAX_VALUE));
+            Telemetry.addToHistogram(TELEMETRY_HISTOGRAM_LOAD_CURSOR, (int) Math.min(took, Integer.MAX_VALUE));
             return cursor;
         }
 
         public String getSearchTerm() {
             return mSearchTerm;
         }
     }
 
--- a/mobile/android/base/home/TopSitesPanel.java
+++ b/mobile/android/base/home/TopSitesPanel.java
@@ -523,17 +523,17 @@ public class TopSitesPanel extends HomeF
         }
 
         @Override
         public Cursor loadCursor() {
             final long start = SystemClock.uptimeMillis();
             final Cursor cursor = BrowserDB.getTopSites(getContext().getContentResolver(), mMaxGridEntries, SEARCH_LIMIT);
             final long end = SystemClock.uptimeMillis();
             final long took = end - start;
-            Telemetry.HistogramAdd(TELEMETRY_HISTOGRAM_LOAD_CURSOR, (int) Math.min(took, Integer.MAX_VALUE));
+            Telemetry.addToHistogram(TELEMETRY_HISTOGRAM_LOAD_CURSOR, (int) Math.min(took, Integer.MAX_VALUE));
             return cursor;
         }
     }
 
     private class VisitedAdapter extends CursorAdapter {
         public VisitedAdapter(Context context, Cursor cursor) {
             super(context, cursor, 0);
         }