#444, #334: retune session store; remove telemetry

This commit is contained in:
Cameron Kaiser 2017-12-15 22:25:52 -08:00
parent 433aae5429
commit 96e1bd02f4
3 changed files with 24 additions and 18 deletions

View File

@ -1013,7 +1013,7 @@ pref("browser.sessionstore.resume_from_crash", true);
pref("browser.sessionstore.resume_session_once", false); pref("browser.sessionstore.resume_session_once", false);
// minimal interval between two save operations in milliseconds // minimal interval between two save operations in milliseconds
pref("browser.sessionstore.interval", 25000); pref("browser.sessionstore.interval", 30000);
// on which sites to save text data, POSTDATA and cookies // on which sites to save text data, POSTDATA and cookies
// 0 = everywhere, 1 = unencrypted sites, 2 = nowhere // 0 = everywhere, 1 = unencrypted sites, 2 = nowhere
pref("browser.sessionstore.privacy_level", 0); pref("browser.sessionstore.privacy_level", 0);
@ -1026,9 +1026,9 @@ pref("browser.sessionstore.max_windows_undo", 2);
// (this pref has no effect if more than 6 hours have passed since the last crash) // (this pref has no effect if more than 6 hours have passed since the last crash)
pref("browser.sessionstore.max_resumed_crashes", 1); pref("browser.sessionstore.max_resumed_crashes", 1);
// number of back button session history entries to restore (-1 = all of them) // number of back button session history entries to restore (-1 = all of them)
pref("browser.sessionstore.max_serialize_back", 10); pref("browser.sessionstore.max_serialize_back", 5);
// number of forward button session history entries to restore (-1 = all of them) // number of forward button session history entries to restore (-1 = all of them)
pref("browser.sessionstore.max_serialize_forward", -1); pref("browser.sessionstore.max_serialize_forward", 5);
// restore_on_demand overrides MAX_CONCURRENT_TAB_RESTORES (sessionstore constant) // restore_on_demand overrides MAX_CONCURRENT_TAB_RESTORES (sessionstore constant)
// and restore_hidden_tabs. When true, tabs will not be restored until they are // and restore_hidden_tabs. When true, tabs will not be restored until they are
// focused (also applies to tabs that aren't visible). When false, the values // focused (also applies to tabs that aren't visible). When false, the values
@ -1051,8 +1051,8 @@ pref("browser.sessionstore.debug", false);
// browser tabs that were not caused by a flush from the parent. // browser tabs that were not caused by a flush from the parent.
// This is a testing flag and should not be used by end-users. // This is a testing flag and should not be used by end-users.
pref("browser.sessionstore.debug.no_auto_updates", false); pref("browser.sessionstore.debug.no_auto_updates", false);
// Forget closed windows/tabs after two weeks // Forget closed windows/tabs after 24 hours
pref("browser.sessionstore.cleanup.forget_closed_after", 1209600000); pref("browser.sessionstore.cleanup.forget_closed_after", 86400000);
// allow META refresh by default // allow META refresh by default
pref("accessibility.blockautorefresh", false); pref("accessibility.blockautorefresh", false);

View File

@ -506,7 +506,7 @@ var SessionStoreInternal = {
throw new Error("SessionStore.init() must only be called once!"); throw new Error("SessionStore.init() must only be called once!");
} }
TelemetryTimestamps.add("sessionRestoreInitialized"); //TelemetryTimestamps.add("sessionRestoreInitialized");
OBSERVING.forEach(function(aTopic) { OBSERVING.forEach(function(aTopic) {
Services.obs.addObserver(this, aTopic, true); Services.obs.addObserver(this, aTopic, true);
}, this); }, this);
@ -519,7 +519,7 @@ var SessionStoreInternal = {
* Initialize the session using the state provided by SessionStartup * Initialize the session using the state provided by SessionStartup
*/ */
initSession: function () { initSession: function () {
TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); //TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS");
let state; let state;
let ss = gSessionStartup; let ss = gSessionStartup;
@ -593,7 +593,7 @@ var SessionStoreInternal = {
this._prefBranch.getBoolPref("sessionstore.resume_session_once")) this._prefBranch.getBoolPref("sessionstore.resume_session_once"))
this._prefBranch.setBoolPref("sessionstore.resume_session_once", false); this._prefBranch.setBoolPref("sessionstore.resume_session_once", false);
TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); //TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS");
return state; return state;
}, },
@ -743,7 +743,7 @@ var SessionStoreInternal = {
// Record telemetry measurements done in the child and update the tab's // Record telemetry measurements done in the child and update the tab's
// cached state. Mark the window as dirty and trigger a delayed write. // cached state. Mark the window as dirty and trigger a delayed write.
this.recordTelemetry(aMessage.data.telemetry); //this.recordTelemetry(aMessage.data.telemetry);
TabState.update(browser, aMessage.data); TabState.update(browser, aMessage.data);
this.saveStateDelayed(win); this.saveStateDelayed(win);
@ -874,9 +874,11 @@ var SessionStoreInternal = {
* value to be recorded for that ID, * value to be recorded for that ID,
*/ */
recordTelemetry: function (telemetry) { recordTelemetry: function (telemetry) {
/*
for (let histogramId in telemetry){ for (let histogramId in telemetry){
Telemetry.getHistogramById(histogramId).add(telemetry[histogramId]); Telemetry.getHistogramById(histogramId).add(telemetry[histogramId]);
} }
*/
}, },
/* ........ Window Event Handlers .............. */ /* ........ Window Event Handlers .............. */
@ -1025,7 +1027,7 @@ var SessionStoreInternal = {
// Nothing to restore now, notify observers things are complete. // Nothing to restore now, notify observers things are complete.
Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, ""); Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
} else { } else {
TelemetryTimestamps.add("sessionRestoreRestoring"); //TelemetryTimestamps.add("sessionRestoreRestoring");
this._restoreCount = aInitialState.windows ? aInitialState.windows.length : 0; this._restoreCount = aInitialState.windows ? aInitialState.windows.length : 0;
// global data must be restored before restoreWindow is called so that // global data must be restored before restoreWindow is called so that
@ -1188,9 +1190,9 @@ var SessionStoreInternal = {
if (initialState) { if (initialState) {
Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP, ""); Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP, "");
} }
TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); //TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS");
this.initializeWindow(aWindow, initialState); this.initializeWindow(aWindow, initialState);
TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); //TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS");
// Let everyone know we're done. // Let everyone know we're done.
this._deferredInitialized.resolve(); this._deferredInitialized.resolve();
@ -2675,7 +2677,7 @@ var SessionStoreInternal = {
var activeWindow = this._getMostRecentBrowserWindow(); var activeWindow = this._getMostRecentBrowserWindow();
TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); //TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS");
if (RunState.isRunning) { if (RunState.isRunning) {
// update the data for all windows with activities since the last save operation // update the data for all windows with activities since the last save operation
this._forEachBrowserWindow(function(aWindow) { this._forEachBrowserWindow(function(aWindow) {
@ -2690,7 +2692,7 @@ var SessionStoreInternal = {
}); });
DirtyWindows.clear(); DirtyWindows.clear();
} }
TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); //TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS");
// An array that at the end will hold all current window data. // An array that at the end will hold all current window data.
var total = []; var total = [];
@ -2710,9 +2712,9 @@ var SessionStoreInternal = {
nonPopupCount++; nonPopupCount++;
} }
TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); //TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_COOKIES_MS");
SessionCookies.update(total); SessionCookies.update(total);
TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); //TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_COOKIES_MS");
// collect the data for all windows yet to be restored // collect the data for all windows yet to be restored
for (ix in this._statesToRestore) { for (ix in this._statesToRestore) {
@ -2877,7 +2879,7 @@ var SessionStoreInternal = {
if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi])) if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi]))
this.onLoad(aWindow); this.onLoad(aWindow);
TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); //TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
// We're not returning from this before we end up calling restoreTabs // We're not returning from this before we end up calling restoreTabs
// for this window, so make sure we send the SSWindowStateBusy event. // for this window, so make sure we send the SSWindowStateBusy event.
@ -3031,7 +3033,7 @@ var SessionStoreInternal = {
// set smoothScroll back to the original value // set smoothScroll back to the original value
tabstrip.smoothScroll = smoothScroll; tabstrip.smoothScroll = smoothScroll;
TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); //TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS");
this._setWindowStateReady(aWindow); this._setWindowStateReady(aWindow);
@ -4146,6 +4148,7 @@ var SessionStoreInternal = {
* Handle an error report from a content process. * Handle an error report from a content process.
*/ */
reportInternalError(data) { reportInternalError(data) {
/*
// For the moment, we only report errors through Telemetry. // For the moment, we only report errors through Telemetry.
if (data.telemetry) { if (data.telemetry) {
for (let key of Object.keys(data.telemetry)) { for (let key of Object.keys(data.telemetry)) {
@ -4153,6 +4156,7 @@ var SessionStoreInternal = {
histogram.add(data.telemetry[key]); histogram.add(data.telemetry[key]);
} }
} }
*/
} }
}; };

View File

@ -1229,7 +1229,9 @@ IncrementalFinalizeRunnable::Run()
return NS_OK; return NS_OK;
} }
#if(0)
TimeStamp start = TimeStamp::Now(); TimeStamp start = TimeStamp::Now();
#endif
ReleaseNow(true); ReleaseNow(true);
if (mDeferredFinalizeFunctions.Length()) { if (mDeferredFinalizeFunctions.Length()) {