Commit 19dddf3b authored by Tim Song's avatar Tim Song Committed by Commit Bot

Ash Tray: Add new metrics to track blocked notifiers.

BUG=1073536

Change-Id: If5988a47ff11f0bc15021c558039c3465e1a3b53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2198602
Commit-Queue: Tim Song <tengs@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarAhmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769016}
parent 96f94eed
......@@ -109,6 +109,7 @@ void QuietModeFeaturePodController::OnNotifiersUpdated(
if (!notifier.enabled)
++disabled_count;
}
RecordDisabledNotifierCount(disabled_count);
if (disabled_count > 0) {
button_->SetSubLabel(l10n_util::GetPluralStringFUTF16(
......@@ -132,4 +133,21 @@ base::string16 QuietModeFeaturePodController::GetQuietModeStateTooltip() {
: IDS_ASH_STATUS_TRAY_NOTIFICATIONS_DO_NOT_DISTURB_OFF_STATE);
}
void QuietModeFeaturePodController::RecordDisabledNotifierCount(
int disabled_count) {
if (!last_disabled_count_.has_value()) {
last_disabled_count_ = disabled_count;
UMA_HISTOGRAM_COUNTS_100("ChromeOS.SystemTray.BlockedNotifiersOnOpen",
disabled_count);
return;
}
if (*last_disabled_count_ == disabled_count)
return;
last_disabled_count_ = disabled_count;
UMA_HISTOGRAM_COUNTS_100("ChromeOS.SystemTray.BlockedNotifiersAfterUpdate",
disabled_count);
}
} // namespace ash
......@@ -9,6 +9,7 @@
#include "ash/public/cpp/notifier_settings_observer.h"
#include "ash/system/unified/feature_pod_controller_base.h"
#include "base/macros.h"
#include "base/optional.h"
#include "base/strings/string16.h"
#include "ui/message_center/message_center_observer.h"
......@@ -44,10 +45,14 @@ class ASH_EXPORT QuietModeFeaturePodController
private:
base::string16 GetQuietModeStateTooltip();
void RecordDisabledNotifierCount(int disabled_count);
UnifiedSystemTrayController* const tray_controller_;
FeaturePodButton* button_ = nullptr;
base::Optional<int> last_disabled_count_;
DISALLOW_COPY_AND_ASSIGN(QuietModeFeaturePodController);
};
......
......@@ -25456,6 +25456,26 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="ChromeOS.SystemTray.BlockedNotifiersAfterUpdate"
units="notifiers" expires_after="2021-05-10">
<owner>tengs@chromium.org</owner>
<owner>gzadina@google.com</owner>
<summary>
Tracks the number of blocked notifiers in the system tray after the user
blocks one or multiple notifiers. Note that this metric records the number
of blocked notifiers *after* the update.
</summary>
</histogram>
<histogram name="ChromeOS.SystemTray.BlockedNotifiersOnOpen" units="notifiers"
expires_after="2021-05-10">
<owner>tengs@chromium.org</owner>
<owner>gzadina@google.com</owner>
<summary>
Tracks the number of blocked notifiers in the system tray when it is opened.
</summary>
</histogram>
<histogram name="ChromeOS.SystemTray.FeaturePodCountOnOpen" units="count"
expires_after="2020-10-04">
<owner>tengs@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment