Bug 1308337 - Post: Remove old background telemetry code r=nalexander
authorGrigory Kruglov <gkruglov@mozilla.com>
Tue, 11 Apr 2017 22:31:18 -0400
changeset 410227 72a455b224e63335c4cf6cce7588d2b9c9de7a5f
parent 410226 bae470a1d3973491f713fdd5d466001abe1c7b79
child 410228 63cc19a2300f356abf1fa03884a9ac3d4792ef57
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1308337
milestone55.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 1308337 - Post: Remove old background telemetry code r=nalexander MozReview-Commit-ID: CONHqQWzB6c
mobile/android/base/android-services.mozbuild
mobile/android/services/src/main/java/org/mozilla/gecko/background/common/telemetry/TelemetryWrapper.java
--- a/mobile/android/base/android-services.mozbuild
+++ b/mobile/android/base/android-services.mozbuild
@@ -772,17 +772,16 @@ sync_java_files = [TOPSRCDIR + '/mobile/
     'background/common/log/writers/LevelFilteringLogWriter.java',
     'background/common/log/writers/LogWriter.java',
     'background/common/log/writers/PrintLogWriter.java',
     'background/common/log/writers/SimpleTagLogWriter.java',
     'background/common/log/writers/StringLogWriter.java',
     'background/common/log/writers/TagLogWriter.java',
     'background/common/log/writers/ThreadLocalTagLogWriter.java',
     'background/common/PrefsBranch.java',
-    'background/common/telemetry/TelemetryWrapper.java',
     'background/db/CursorDumper.java',
     'background/db/Tab.java',
     'background/fxa/FxAccount20CreateDelegate.java',
     'background/fxa/FxAccount20LoginDelegate.java',
     'background/fxa/FxAccountClient.java',
     'background/fxa/FxAccountClient20.java',
     'background/fxa/FxAccountClientException.java',
     'background/fxa/FxAccountRemoteError.java',
deleted file mode 100644
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/background/common/telemetry/TelemetryWrapper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.background.common.telemetry;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.mozilla.gecko.background.common.log.Logger;
-
-/**
- * Android Background Services are normally built into Fennec, but can also be
- * built as a stand-alone APK for rapid local development. The current Telemetry
- * implementation is coupled to Gecko, and Background Services should not
- * interact with Gecko directly. To maintain this independence, Background
- * Services lazily introspects the relevant Telemetry class from the enclosing
- * package, warning but otherwise ignoring failures during introspection or
- * invocation.
- * <p>
- * It is possible that Background Services will introspect and invoke the
- * Telemetry implementation while Gecko is not running. In this case, the Fennec
- * process itself buffers Telemetry events until such time as they can be
- * flushed to disk and uploaded. <b>There is no guarantee that all Telemetry
- * events will be uploaded!</b> Depending on the volume of data and the
- * application lifecycle, Telemetry events may be dropped.
- */
-public class TelemetryWrapper {
-  private static final String LOG_TAG = TelemetryWrapper.class.getSimpleName();
-
-  // Marking this volatile maintains thread safety cheaply.
-  private static volatile Method mAddToHistogram;
-
-  public static void addToHistogram(String key, int value) {
-    if (mAddToHistogram == null) {
-      try {
-        final Class<?> telemetry = Class.forName("org.mozilla.gecko.Telemetry");
-        mAddToHistogram = telemetry.getMethod("addToHistogram", String.class, int.class);
-      } catch (ClassNotFoundException e) {
-        Logger.warn(LOG_TAG, "org.mozilla.gecko.Telemetry class found!");
-        return;
-      } catch (NoSuchMethodException e) {
-        Logger.warn(LOG_TAG, "org.mozilla.gecko.Telemetry.addToHistogram(String, int) method not found!");
-        return;
-      }
-    }
-
-    if (mAddToHistogram != null) {
-      try {
-        mAddToHistogram.invoke(null, key, value);
-      } catch (IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
-        Logger.warn(LOG_TAG, "Got exception invoking telemetry!");
-      }
-    }
-  }
-}