Skip to content

Commit

Permalink
Log the result of loading a profile for notifications
Browse files Browse the repository at this point in the history
This adds a UMA metric to track if loading the profile from a
notification action is successful or not. Only logged when we're using a
system notification bridge, so not on Chrome OS and not when we use
Chrome's own notifications.

Bug: None
Change-Id: Ibb357b3036134b8f558a838c85777e2a8cc8a48f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2776011
Commit-Queue: Richard Knoll <knollr@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865300}
  • Loading branch information
rknoll authored and Chromium LUCI CQ committed Mar 22, 2021
1 parent 075821d commit 0069344
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
Expand Down Expand Up @@ -276,9 +277,9 @@ void NotificationDisplayServiceImpl::ProfileLoadedCallback(
const base::Optional<std::u16string>& reply,
const base::Optional<bool>& by_user,
Profile* profile) {
base::UmaHistogramBoolean("Notifications.LoadProfileResult",
profile != nullptr);
if (!profile) {
// TODO(miguelg): Add UMA for this condition.
// Perhaps propagate this through PersistentNotificationStatus.
LOG(WARNING) << "Profile not loaded correctly";
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,18 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>

<histogram name="Notifications.LoadProfileResult" enum="BooleanSuccess"
expires_after="M96">
<owner>knollr@chromium.org</owner>
<owner>peter@chromium.org</owner>
<summary>
Records the result of loading the profile when forwarding a notification
event. Logged on each notification action (click, close, settings, disable)
on platforms that use system notifications (not on Chrome OS or when we're
using Chrome's notifications).
</summary>
</histogram>

<histogram name="Notifications.macOS.ActionReceived.{Style}"
enum="BooleanValid" expires_after="M96">
<owner>knollr@chromium.org</owner>
Expand Down

0 comments on commit 0069344

Please sign in to comment.