зеркало из https://github.com/mozilla/gecko-dev.git
Bug 723515 - Add telemetry probe for the opening time of the Firefox app menu. r=ttaubert
This commit is contained in:
Родитель
0cff7b3fa0
Коммит
57c3670934
|
@ -1766,6 +1766,23 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
|||
document.getElementById("appmenu_charsetMenu").hidden = true;
|
||||
#endif
|
||||
|
||||
let appMenuButton = document.getElementById("appmenu-button");
|
||||
let appMenuPopup = document.getElementById("appmenu-popup");
|
||||
if (appMenuButton && appMenuPopup) {
|
||||
let appMenuOpening = null;
|
||||
appMenuButton.addEventListener("mousedown", function(event) {
|
||||
if (event.button == 0)
|
||||
appMenuOpening = new Date();
|
||||
}, false);
|
||||
appMenuPopup.addEventListener("popupshown", function(event) {
|
||||
if (event.target != appMenuPopup || !appMenuOpening)
|
||||
return;
|
||||
let duration = new Date() - appMenuOpening;
|
||||
appMenuOpening = null;
|
||||
Services.telemetry.getHistogramById("FX_APP_MENU_OPEN_MS").add(duration);
|
||||
}, false);
|
||||
}
|
||||
|
||||
window.addEventListener("mousemove", MousePosTracker, false);
|
||||
window.addEventListener("dragover", MousePosTracker, false);
|
||||
|
||||
|
|
|
@ -313,6 +313,7 @@ HISTOGRAM(FX_TAB_ANIM_OPEN_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by
|
|||
HISTOGRAM(FX_TAB_ANIM_CLOSE_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab closing animation in milliseconds")
|
||||
HISTOGRAM_BOOLEAN(FX_CONTEXT_SEARCH_AND_TAB_SELECT, "Firefox: Background tab was selected within 5 seconds of searching from the context menu")
|
||||
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")
|
||||
|
||||
/**
|
||||
* Thumbnail Service telemetry.
|
||||
|
|
Загрузка…
Ссылка в новой задаче