Bug 1437399 - Remove leftover telemetry code in nsPlacesAutocomplete. r=stefanh
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sun, 11 Feb 2018 22:28:43 +0100
changeset 31089 8c7e7fdff34e61378d8e8cf1067f92bce66489cb
parent 31088 d116981753de2b088dca15dc4ec3d32de127b43d
child 31090 782575b2232e9fcd17a8b20588d19132cf6345ce
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersstefanh
bugs1437399
Bug 1437399 - Remove leftover telemetry code in nsPlacesAutocomplete. r=stefanh
suite/common/places/nsPlacesAutoComplete.js
--- a/suite/common/places/nsPlacesAutoComplete.js
+++ b/suite/common/places/nsPlacesAutoComplete.js
@@ -3,18 +3,16 @@
  * 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/. */
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.defineModuleGetter(this, "PlacesUtils",
                                "resource://gre/modules/PlacesUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "TelemetryStopwatch",
-                               "resource://gre/modules/TelemetryStopwatch.jsm");
 ChromeUtils.defineModuleGetter(this, "NetUtil",
                                "resource://gre/modules/NetUtil.jsm");
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Constants
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
@@ -531,17 +529,16 @@ nsPlacesAutoComplete.prototype = {
       [this._getBoundAdaptiveQuery()];
 
     if (this._hasBehavior("openpage")) {
       queries.push(this._getBoundOpenPagesQuery(tokens));
     }
     queries.push(query);
 
     // Start executing our queries.
-    this._telemetryStartTime = Date.now();
     this._executeQueries(queries);
 
     // Set up our persistent state for the duration of the search.
     this._searchTokens = tokens;
     this._usedPlaces = {};
   },
 
   stopSearch: function PAC_stopSearch()
@@ -788,29 +785,16 @@ nsPlacesAutoComplete.prototype = {
   {
     let result = this._result;
     let resultCode = result.matchCount ? "RESULT_SUCCESS" : "RESULT_NOMATCH";
     if (aSearchOngoing) {
       resultCode += "_ONGOING";
     }
     result.setSearchResult(Ci.nsIAutoCompleteResult[resultCode]);
     this._listener.onSearchResult(this, result);
-    if (this._telemetryStartTime) {
-      let elapsed = Date.now() - this._telemetryStartTime;
-      if (elapsed > 50) {
-        try {
-          Services.telemetry
-                  .getHistogramById("PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS")
-                  .add(elapsed);
-        } catch (ex) {
-          Components.utils.reportError("Unable to report telemetry.");
-        }
-      }
-      this._telemetryStartTime = null;
-    }
   },
 
   /**
    * Synchronize suggest.* prefs with autocomplete.enabled.
    */
   _syncEnabledPref: function PAC_syncEnabledPref()
   {
     let suggestPrefs = ["suggest.history", "suggest.bookmark", "suggest.openpage"];