Bug 1058951 - Added telemetry probes to measure possible performance impacts of future changes at the places database. r=mak

This commit is contained in:
Bernardo P. Rittmeyer 2014-09-04 14:15:00 +02:00
Родитель 14b5bc554e
Коммит 2d7dc90bc9
4 изменённых файлов: 46 добавлений и 1 удалений

Просмотреть файл

@ -3,6 +3,8 @@
* 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/. */
Components.utils.import("resource://gre/modules/TelemetryStopwatch.jsm");
var gHistoryTree;
var gSearchBox;
var gHistoryGrouping = "";
@ -79,10 +81,16 @@ function searchHistory(aInput)
options.resultType = resultType;
options.includeHidden = !!aInput;
if (gHistoryGrouping == "lastvisited")
this.TelemetryStopwatch.start("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS");
// call load() on the tree manually
// instead of setting the place attribute in history-panel.xul
// otherwise, we will end up calling load() twice
gHistoryTree.load([query], options);
if (gHistoryGrouping == "lastvisited")
this.TelemetryStopwatch.finish("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS");
}
window.addEventListener("SidebarFocused",

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/TelemetryStopwatch.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils",
"resource:///modules/MigrationUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
@ -16,6 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils",
"resource://gre/modules/DownloadUtils.jsm");
const RESTORE_FILEPICKER_FILTER_EXT = "*.json;*.jsonlz4";
const HISTORY_LIBRARY_SEARCH_TELEMETRY = "PLACES_HISTORY_LIBRARY_SEARCH_TIME_MS";
var PlacesOrganizer = {
_places: null,
@ -855,7 +857,9 @@ var PlacesSearchBox = {
currentView.load([query], options);
}
else {
TelemetryStopwatch.start(HISTORY_LIBRARY_SEARCH_TELEMETRY);
currentView.applyFilter(filterString, null, true);
TelemetryStopwatch.finish(HISTORY_LIBRARY_SEARCH_TELEMETRY);
}
break;
case "downloads":

Просмотреть файл

@ -67,7 +67,7 @@ const TITLE_SEARCH_ENGINE_SEPARATOR = " \u00B7\u2013\u00B7 ";
// Telemetry probes.
const TELEMETRY_1ST_RESULT = "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS";
const TELEMETRY_6_FIRST_RESULTS = "PLACES_AUTOCOMPLETE_6_FIRST_RESULTS_TIME_MS";
// The default frecency value used when inserting search engine results.
const FRECENCY_SEARCHENGINES_DEFAULT = 1000;
@ -642,6 +642,8 @@ Search.prototype = {
return;
TelemetryStopwatch.start(TELEMETRY_1ST_RESULT);
if (this._searchString)
TelemetryStopwatch.start(TELEMETRY_6_FIRST_RESULTS);
// Since we call the synchronous parseSubmissionURL function later, we must
// wait for the initialization of PlacesSearchAutocompleteProvider first.
@ -845,6 +847,9 @@ Search.prototype = {
notifyResults = true;
}
if (this._result.matchCount == 6)
TelemetryStopwatch.finish(TELEMETRY_6_FIRST_RESULTS);
if (this._result.matchCount == Prefs.maxRichResults || !this.pending) {
// We have enough results, so stop running our search.
this.cancel();
@ -1337,6 +1342,7 @@ UnifiedComplete.prototype = {
*/
finishSearch: function (notify=false) {
TelemetryStopwatch.cancel(TELEMETRY_1ST_RESULT);
TelemetryStopwatch.cancel(TELEMETRY_6_FIRST_RESULTS);
// Clear state now to avoid race conditions, see below.
let search = this._currentSearch;
delete this._currentSearch;

Просмотреть файл

@ -3186,6 +3186,33 @@
"extended_statistics_ok": true,
"description": "PLACES: Time for first autocomplete result if > 50ms (ms)"
},
"PLACES_AUTOCOMPLETE_6_FIRST_RESULTS_TIME_MS": {
"expires_in_version": "never",
"kind": "exponential",
"low": 50,
"high": "1000",
"n_buckets": 30,
"extended_statistics_ok": true,
"description": "PLACES: Time for the 6 first autocomplete results (ms)"
},
"HISTORY_LASTVISITED_TREE_QUERY_TIME_MS": {
"expires_in_version": "never",
"kind": "exponential",
"low": 50,
"high": "2000",
"n_buckets": 30,
"extended_statistics_ok": true,
"description": "PLACES: Time to load the sidebar history tree sorted by last visit (ms)"
},
"PLACES_HISTORY_LIBRARY_SEARCH_TIME_MS": {
"expires_in_version": "never",
"kind": "exponential",
"low": 50,
"high": "1000",
"n_buckets": 30,
"extended_statistics_ok": true,
"description": "PLACES: Time to search the history library (ms)"
},
"PLACES_AUTOCOMPLETE_URLINLINE_DOMAIN_QUERY_TIME_MS": {
"expires_in_version": "never",
"kind": "exponential",