From 8f5539d3cd2f1a5082d0b1d08522bcef0c74e3f7 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Thu, 9 Feb 2012 11:10:15 +0100 Subject: [PATCH] Bug 723165 - Telemetry for time needed to show the Bookmarks toolbar. r=dietrich --- browser/components/places/content/browserPlacesViews.js | 5 +++++ toolkit/components/telemetry/TelemetryHistograms.h | 1 + 2 files changed, 6 insertions(+) diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js index 97e533c07aac..050a16f3c451 100644 --- a/browser/components/places/content/browserPlacesViews.js +++ b/browser/components/places/content/browserPlacesViews.js @@ -41,6 +41,7 @@ * ***** END LICENSE BLOCK ***** */ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +Components.utils.import("resource://gre/modules/Services.jsm"); /** * The base view implements everything that's common to the toolbar and @@ -808,6 +809,7 @@ PlacesViewBase.prototype = { }; function PlacesToolbar(aPlace) { + let startTime = Date.now(); // Add some smart getters for our elements. let thisView = this; [ @@ -836,6 +838,9 @@ function PlacesToolbar(aPlace) { this._addEventListeners(window, ["resize", "unload"], false); PlacesViewBase.call(this, aPlace); + + Services.telemetry.getHistogramById("FX_BOOKMARKS_TOOLBAR_INIT_MS") + .add(Date.now() - startTime); } PlacesToolbar.prototype = { diff --git a/toolkit/components/telemetry/TelemetryHistograms.h b/toolkit/components/telemetry/TelemetryHistograms.h index d7aadf23bcdb..6bedfbc8aed4 100644 --- a/toolkit/components/telemetry/TelemetryHistograms.h +++ b/toolkit/components/telemetry/TelemetryHistograms.h @@ -324,6 +324,7 @@ HISTOGRAM_BOOLEAN(FX_CONTEXT_SEARCH_AND_TAB_SELECT, "Firefox: Background tab was HISTOGRAM_BOOLEAN(FX_KEYWORD_URL_USERSET, "Firefox: keyword.URL has a user-set value") HISTOGRAM(FX_IDENTITY_POPUP_OPEN_MS, 1, 1000, 10, EXPONENTIAL, "Firefox: Time taken by the identity popup to open in milliseconds") HISTOGRAM(FX_APP_MENU_OPEN_MS, 1, 1000, 10, EXPONENTIAL, "Firefox: Time taken by the app-menu opening in milliseconds") +HISTOGRAM(FX_BOOKMARKS_TOOLBAR_INIT_MS, 50, 5000, 10, EXPONENTIAL, "Firefox: Time to initialize the bookmarks toolbar view (ms)") /** * Thumbnail Service telemetry.