diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 17:47:32 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-18 17:47:32 +0000 |
commit | d6d4daeb79e56a071818436148d5fbd62c4f2d8f (patch) | |
tree | c2848b58cc3b6182bf862ba99e2eec3a743ad4e4 /chrome/browser/ui/browser.cc | |
parent | 0e6ee141ecd519c6b849ffd60f5e58ee7ad05f12 (diff) | |
download | chromium_src-d6d4daeb79e56a071818436148d5fbd62c4f2d8f.zip chromium_src-d6d4daeb79e56a071818436148d5fbd62c4f2d8f.tar.gz chromium_src-d6d4daeb79e56a071818436148d5fbd62c4f2d8f.tar.bz2 |
cros: Record UMA stats for tab discards in low memory conditions
* Per discussion with jar@, bin users into categories by number of tabs they have open as a proxy for how "heavily" they use Chrome.
* Separately track time-to-first-discard, as that should be longer as users take a little while to open up all their tabs.
* Also report snapshot of system-wide memory consumption at the time of the discard, to investigate tuning the kernel low-memory signal threshold.
BUG=123179
TEST=use chrome://discards to discard a few tabs, then check chrome://histograms and search for "TabDiscard" to verify the discards were counted
Review URL: https://chromiumcodereview.appspot.com/9969189
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r-- | chrome/browser/ui/browser.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index b7c90ee..66744f5 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -3539,8 +3539,9 @@ void Browser::ActiveTabChanged(TabContentsWrapper* old_contents, base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); if (parsed_command_line.HasSwitch(switches::kReloadKilledTabs)) { - // Log to track down crash crbug.com/119068 LOG(WARNING) << "Reloading killed tab at " << index; + static int reload_count = 0; + HISTOGRAM_COUNTS_10000("Tabs.SadTab.ReloadCount", ++reload_count); Reload(CURRENT_TAB); did_reload = true; } @@ -3548,9 +3549,9 @@ void Browser::ActiveTabChanged(TabContentsWrapper* old_contents, // Discarded tabs always get reloaded. if (!did_reload && IsTabDiscarded(index)) { - // Log to track down crash crbug.com/119068 - LOG(WARNING) << "Reloading discarded tab at " << index - << " gesture " << user_gesture; + LOG(WARNING) << "Reloading discarded tab at " << index; + static int reload_count = 0; + HISTOGRAM_COUNTS_10000("Tabs.Discard.ReloadCount", ++reload_count); Reload(CURRENT_TAB); } |