diff options
author | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 20:08:15 +0000 |
---|---|---|
committer | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 20:08:15 +0000 |
commit | 8cf815be4062fbb05232bec82ec44395a5e8c9a1 (patch) | |
tree | c72c7f47378654fdb45827d0e927b1407b7bc541 | |
parent | ca66296a1952514eb42a8b4446fe4b5e7c819599 (diff) | |
download | chromium_src-8cf815be4062fbb05232bec82ec44395a5e8c9a1.zip chromium_src-8cf815be4062fbb05232bec82ec44395a5e8c9a1.tar.gz chromium_src-8cf815be4062fbb05232bec82ec44395a5e8c9a1.tar.bz2 |
Add UMA stats for discarded tabs on a per logged in user base
Each discarded tab will be "stored" in the bucket for the number of users logged in at the time of the occurrence.
To get to a useful number, the value needs to be normalized by dividing the absolute value per bucket by the corresponding UsersPerSession bucket (in percent).
BUG=321739
TEST=visual
Review URL: https://codereview.chromium.org/104713003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239023 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/multi_profile_uma.cc | 6 | ||||
-rw-r--r-- | ash/multi_profile_uma.h | 3 | ||||
-rw-r--r-- | chrome/browser/chromeos/memory/oom_priority_manager.cc | 9 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 10 |
4 files changed, 28 insertions, 0 deletions
diff --git a/ash/multi_profile_uma.cc b/ash/multi_profile_uma.cc index ec29a83..cbf3b05 100644 --- a/ash/multi_profile_uma.cc +++ b/ash/multi_profile_uma.cc @@ -48,4 +48,10 @@ void MultiProfileUMA::RecordUserCount(int number_of_users) { UMA_HISTOGRAM_COUNTS_100("MultiProfile.UsersPerSession", number_of_users); } +// static +void MultiProfileUMA::RecordDiscardedTab(int number_of_users) { + UMA_HISTOGRAM_COUNTS_100("MultiProfile.DiscardedTabsPerUser", + number_of_users); +} + } // namespace ash diff --git a/ash/multi_profile_uma.h b/ash/multi_profile_uma.h index e0b411f..937b4d81 100644 --- a/ash/multi_profile_uma.h +++ b/ash/multi_profile_uma.h @@ -72,6 +72,9 @@ class ASH_EXPORT MultiProfileUMA { // Record number of users joined into a session. Called upon logout. static void RecordUserCount(int number_of_users); + // Record a discarded tab in the number of running users bucket. + static void RecordDiscardedTab(int number_of_users); + private: DISALLOW_IMPLICIT_CONSTRUCTORS(MultiProfileUMA); }; diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.cc b/chrome/browser/chromeos/memory/oom_priority_manager.cc index 6de6c82..c8d9538 100644 --- a/chrome/browser/chromeos/memory/oom_priority_manager.cc +++ b/chrome/browser/chromeos/memory/oom_priority_manager.cc @@ -8,6 +8,9 @@ #include <set> #include <vector> +#include "ash/multi_profile_uma.h" +#include "ash/session_state_delegate.h" +#include "ash/shell.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" @@ -321,6 +324,12 @@ void OomPriorityManager::RecordDiscardStatistics() { UMA_HISTOGRAM_CUSTOM_COUNTS( "Tabs.Discard.TabCount", GetTabCount(), 1, 100, 50); + // Record the discarded tab in relation to the amount of simultaneously + // logged in users. + ash::MultiProfileUMA::RecordDiscardedTab( + ash::Shell::GetInstance()->session_state_delegate()-> + NumberOfLoggedInUsers()); + // TODO(jamescook): If the time stats prove too noisy, then divide up users // based on how heavily they use Chrome using tab count as a proxy. // Bin into <= 1, <= 2, <= 4, <= 8, etc. diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 133dc95..a3d0bd7 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -7222,6 +7222,16 @@ other types of suffix sets. </summary> </histogram> +<histogram name="MultiProfile.DiscardedTabsPerUser"> + <summary> + The relation of discarded tabs vs. the amount of simultaneous users. The + counts are the number of discards and the buckets are the number of users. + Since the count values are absolute numbers, they need to be normalized + before use - so divide the counts by the percentage of users found under + 'MultiProfile.UsersPerSession'. + </summary> +</histogram> + <histogram name="MultiProfile.SessionMode" enum="MultiProfileSessionMode"> <summary> The session counter for different multi profile modes which gets stored once |