Remove TelemetryStopwatch call sites from toolkit components.

Tag #21
This commit is contained in:
wolfbeast 2018-08-20 09:33:07 +02:00 committed by Roy Tam
commit e3a9020c5d
5 changed files with 0 additions and 51 deletions

View file

@ -56,7 +56,6 @@ Cu.import("resource://gre/modules/Task.jsm", this);
// The implementation of communications
Cu.import("resource://gre/modules/PromiseWorker.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this);
Cu.import("resource://gre/modules/AsyncShutdown.jsm", this);
var Native = Cu.import("resource://gre/modules/osfile/osfile_native.jsm", {});
@ -1171,13 +1170,10 @@ File.writeAtomic = function writeAtomic(path, buffer, options = {}) {
if (isTypedArray(buffer) && (!("bytes" in options))) {
options.bytes = buffer.byteLength;
};
let refObj = {};
TelemetryStopwatch.start("OSFILE_WRITEATOMIC_JANK_MS", refObj);
let promise = Scheduler.post("writeAtomic",
[Type.path.toMsg(path),
Type.void_t.in_ptr.toMsg(buffer),
options], [options, buffer, path]);
TelemetryStopwatch.finish("OSFILE_WRITEATOMIC_JANK_MS", refObj);
return promise;
};

View file

@ -262,8 +262,6 @@ Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
"resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
@ -887,10 +885,6 @@ Search.prototype = {
if (!this.pending)
return;
TelemetryStopwatch.start(TELEMETRY_1ST_RESULT, this);
if (this._searchString)
TelemetryStopwatch.start(TELEMETRY_6_FIRST_RESULTS, this);
// Since we call the synchronous parseSubmissionURL function later, we must
// wait for the initialization of PlacesSearchAutocompleteProvider first.
yield PlacesSearchAutocompleteProvider.ensureInitialized();
@ -1468,9 +1462,6 @@ Search.prototype = {
},
_onResultRow: function (row) {
if (this._localMatchesCount == 0) {
TelemetryStopwatch.finish(TELEMETRY_1ST_RESULT, this);
}
let queryType = row.getResultByIndex(QUERYINDEX_QUERYTYPE);
let match;
switch (queryType) {
@ -1566,9 +1557,6 @@ Search.prototype = {
match.style,
match.finalCompleteValue);
if (this._result.matchCount == 6)
TelemetryStopwatch.finish(TELEMETRY_6_FIRST_RESULTS, this);
this.notifyResults(true);
},
@ -2088,8 +2076,6 @@ UnifiedComplete.prototype = {
* results or not.
*/
finishSearch: function (notify=false) {
TelemetryStopwatch.cancel(TELEMETRY_1ST_RESULT, this);
TelemetryStopwatch.cancel(TELEMETRY_6_FIRST_RESULTS, this);
// Clear state now to avoid race conditions, see below.
let search = this._currentSearch;
if (!search)

View file

@ -8,8 +8,6 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
"resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
@ -1510,8 +1508,6 @@ urlInlineComplete.prototype = {
// Do a synchronous search on the table of hosts.
let query = this._hostQuery;
query.params.search_string = this._currentSearchString.toLowerCase();
// This is just to measure the delay to reach the UI, not the query time.
TelemetryStopwatch.start(DOMAIN_QUERY_TELEMETRY);
let wrapper = new AutoCompleteStatementCallbackWrapper(this, {
handleResult: aResultSet => {
if (this._pendingSearch != pendingSearch)
@ -1541,7 +1537,6 @@ urlInlineComplete.prototype = {
handleCompletion: aReason => {
if (this._pendingSearch != pendingSearch)
return;
TelemetryStopwatch.finish(DOMAIN_QUERY_TELEMETRY);
this._finishSearch();
}
}, this._db);

View file

@ -21,8 +21,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
"resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SearchStaticData",
"resource://gre/modules/SearchStaticData.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
@ -3873,21 +3871,17 @@ SearchService.prototype = {
LOG("SearchService.init");
let self = this;
if (!this._initStarted) {
TelemetryStopwatch.start("SEARCH_SERVICE_INIT_MS");
this._initStarted = true;
Task.spawn(function* task() {
try {
// Complete initialization by calling asynchronous initializer.
yield self._asyncInit();
TelemetryStopwatch.finish("SEARCH_SERVICE_INIT_MS");
} catch (ex) {
if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) {
// No need to pursue asynchronous because synchronous fallback was
// called and has finished.
TelemetryStopwatch.finish("SEARCH_SERVICE_INIT_MS");
} else {
self._initObservers.reject(ex);
TelemetryStopwatch.cancel("SEARCH_SERVICE_INIT_MS");
}
}
});

View file

@ -792,19 +792,6 @@
<field name="arrowKeysShouldWrap" readonly="true">
/Mac/.test(navigator.platform)
</field>
<property name="TelemetryStopwatch" readonly="true">
<getter><![CDATA[
let module = {};
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", module);
Object.defineProperty(this, "TelemetryStopwatch", {
configurable: true,
enumerable: true,
writable: true,
value: module.TelemetryStopwatch
});
return module.TelemetryStopwatch;
]]></getter>
</property>
</implementation>
<handlers>
@ -814,11 +801,6 @@
return;
if (this != this.parentNode.selectedItem) { // Not selected yet
let stopwatchid = this.parentNode.getAttribute("stopwatchid");
if (stopwatchid) {
this.TelemetryStopwatch.start(stopwatchid);
}
// Call this before setting the 'ignorefocus' attribute because this
// will pass on focus if the formerly selected tab was focused as well.
this.parentNode._selectNewTab(this);
@ -836,10 +818,6 @@
this.setAttribute("ignorefocus", "true");
setTimeout(tab => tab.removeAttribute("ignorefocus"), 0, this);
}
if (stopwatchid) {
this.TelemetryStopwatch.finish(stopwatchid);
}
}
// Otherwise this tab is already selected and we will fall
// through to mousedown behavior which sets focus on the current tab,