diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 3096c9249efb..c48eb6507d24 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1271,12 +1271,8 @@ if (t.pinned) tabContainer._handleNewTab(t); else { - if (tabContainer._tabAnimationLoggingEnabled) { - t._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .startFrameTimeRecording(); - } - t._animStartTime = Date.now(); + tabContainer._handleTabTelemetryStart(tabContainer, t, aURI); + t.setAttribute("fadein", "true"); // This call to adjustTabstrip is redundant but needed so that @@ -1578,12 +1574,7 @@ return; } - if (this.tabContainer._tabAnimationLoggingEnabled) { - aTab._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .startFrameTimeRecording(); - } - aTab._animStartTime = Date.now(); + this.tabContainer._handleTabTelemetryStart(this.tabContainer, aTab); this._blurTab(aTab); aTab.removeAttribute("fadein"); @@ -2905,6 +2896,7 @@ } catch (ex) { this._tabAnimationLoggingEnabled = false; } + this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled"); ]]> @@ -3504,6 +3496,98 @@ + + + + + + + + + + + + + 0) { + let averageInterval = 0; + let averagePaint = paints[0]; + for (let i = 1; i < frameCount; i++) { + averageInterval += intervals[i]; + averagePaint += paints[i]; + }; + averagePaint /= frameCount; + averageInterval = (frameCount == 1) + ? averagePaint + : averageInterval / (frameCount - 1); + + Services.telemetry.getHistogramById("FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS").add(averageInterval); + Services.telemetry.getHistogramById("FX_TAB_ANIM_ANY_FRAME_PAINT_MS").add(averagePaint); + + if (aTab._recordingTabOpenPlain) { + delete aTab._recordingTabOpenPlain; + // While we do have a telemetry probe NEWTAB_PAGE_ENABLED to monitor newtab preview, it'll be + // easier to overview the data without slicing by it. Hence the additional histograms with _PREVIEW. + let preview = this._browserNewtabpageEnabled ? "_PREVIEW" : ""; + Services.telemetry.getHistogramById("FX_TAB_ANIM_OPEN" + preview + "_FRAME_INTERVAL_MS").add(averageInterval); + Services.telemetry.getHistogramById("FX_TAB_ANIM_OPEN" + preview + "_FRAME_PAINT_MS").add(averagePaint); + } + } + ]]> + + + @@ -3520,25 +3604,7 @@ var tab = event.target; - if (tab._animStartTime) { - Services.telemetry.getHistogramById(tab.closing ? - "FX_TAB_ANIM_CLOSE_MS" : - "FX_TAB_ANIM_OPEN_MS") - .add(Date.now() - tab._animStartTime); - tab._animStartTime = 0; - - if (this._tabAnimationLoggingEnabled && tab.hasOwnProperty("_recordingHandle")) { - let paints = {}; - let intervals = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .stopFrameTimeRecording(tab._recordingHandle, paints); - let msg = "Tab " + (tab.closing ? "close" : "open") + " (Frame-interval / paint-processing):\n"; - for (let i = 0; i < intervals.length; i++) { - msg += Math.round(intervals[i]) + " / " + Math.round(paints.value[i]) + "\n"; - } - Services.console.logStringMessage(msg); - } - } + this._handleTabTelemetryEnd(tab); if (tab.getAttribute("fadein") == "true") { if (tab._fullyOpen) diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 95dd9b63ac77..b6b3ef5c0feb 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -2060,6 +2060,45 @@ "n_buckets": 10, "description": "Firefox: Time taken by the tab closing animation in milliseconds" }, + "FX_TAB_ANIM_OPEN_PREVIEW_FRAME_INTERVAL_MS": { + "kind": "exponential", + "low" : 7, + "high": "500", + "n_buckets": 50, + "description": "Average frame interval during tab open animation of about:newtab (preview=on), when other tabs are unaffected" + }, + "FX_TAB_ANIM_OPEN_PREVIEW_FRAME_PAINT_MS": { + "kind": "exponential", + "high": "500", + "n_buckets": 30, + "description": "Average paint duration during tab open animation of about:newtab (preview=on), when other tabs are unaffected" + }, + "FX_TAB_ANIM_OPEN_FRAME_INTERVAL_MS": { + "kind": "exponential", + "low" : 7, + "high": "500", + "n_buckets": 50, + "description": "Average frame interval during tab open animation of about:newtab (preview=off), when other tabs are unaffected" + }, + "FX_TAB_ANIM_OPEN_FRAME_PAINT_MS": { + "kind": "exponential", + "high": "500", + "n_buckets": 30, + "description": "Average paint duration during tab open animation of about:newtab (preview=off), when other tabs are unaffected" + }, + "FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS": { + "kind": "exponential", + "low" : 7, + "high": "500", + "n_buckets": 50, + "description": "Average frame interval during any tab open/close animation (excluding tabstrip scroll)" + }, + "FX_TAB_ANIM_ANY_FRAME_PAINT_MS": { + "kind": "exponential", + "high": "500", + "n_buckets": 30, + "description": "Average paint duration during any tab open/close animation (excluding tabstrip scroll)" + }, "FX_TAB_SWITCH_UPDATE_MS": { "kind": "exponential", "high": "1000",