Bug 710431, add telemetry for new browser window command, r=dao

This commit is contained in:
Neil Deakin 2012-03-09 10:41:50 -05:00
Родитель a72e26ef93
Коммит 6bd71c120f
2 изменённых файлов: 18 добавлений и 0 удалений

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

@ -155,6 +155,9 @@ __defineSetter__("PluralForm", function (val) {
return this.PluralForm = val;
});
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
"resource:///modules/TelemetryStopwatch.jsm");
#ifdef MOZ_SERVICES_SYNC
XPCOMUtils.defineLazyGetter(this, "Weave", function() {
let tmp = {};
@ -3641,6 +3644,20 @@ function toOpenWindowByType(inType, uri, features)
function OpenBrowserWindow()
{
var telemetryObj = {};
TelemetryStopwatch.start("FX_NEW_WINDOW_MS", telemetryObj);
function newDocumentShown(doc, topic, data) {
if (topic == "document-shown" &&
doc != document &&
doc.location == "chrome://browser/content/browser.xul" &&
doc.defaultView == win) {
Services.obs.removeObserver(newDocumentShown, "document-shown");
TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj);
}
};
Services.obs.addObserver(newDocumentShown, "document-shown", false);
var charsetArg = new String();
var handler = Components.classes["@mozilla.org/browser/clh;1"]
.getService(Components.interfaces.nsIBrowserHandler);

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

@ -362,6 +362,7 @@ HISTOGRAM_BOOLEAN(FX_KEYWORD_URL_USERSET, "Firefox: keyword.URL has a user-set v
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)")
HISTOGRAM(FX_NEW_WINDOW_MS, 1, 10000, 20, EXPONENTIAL, "Firefox: Time taken to open a new browser window (ms)")
/**
* Thumbnail Service telemetry.