Commit 0570be95 authored by Istiaque Ahmed's avatar Istiaque Ahmed Committed by Commit Bot

[Extensions Service Worker] Add histogram for event dispatch.

This CL adds the histogram
Extensions.Events.DispatchWithServiceWorkerBackground when an extension
event is dispatched to the background service worker of an extension.

Bug: None
Change-Id: I6a119dfb4d39b518201c8cf166e99a2f4595dac1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441949
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: default avatarDavid Bertoni <dbertoni@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812576}
parent b4c5946b
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/atomic_sequence_num.h" #include "base/atomic_sequence_num.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
...@@ -831,6 +832,10 @@ void EventRouter::ReportEvent(events::HistogramValue histogram_value, ...@@ -831,6 +832,10 @@ void EventRouter::ReportEvent(events::HistogramValue histogram_value,
"Extensions.Events.DispatchWithRunningEventPage", histogram_value, "Extensions.Events.DispatchWithRunningEventPage", histogram_value,
events::ENUM_BOUNDARY); events::ENUM_BOUNDARY);
} }
} else if (BackgroundInfo::IsServiceWorkerBased(extension)) {
base::UmaHistogramEnumeration(
"Extensions.Events.DispatchWithServiceWorkerBackground",
histogram_value, events::ENUM_BOUNDARY);
} }
} }
......
...@@ -1079,6 +1079,17 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -1079,6 +1079,17 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="Extensions.Events.DispatchWithServiceWorkerBackground"
enum="ExtensionEvents" expires_after="2021-10-01">
<owner>lazyboy@chromium.org</owner>
<owner>dbertoni@chromium.org</owner>
<summary>
Recorded every time an event is dispatched to a service worker based
extension background context. When this metric is recorded,
Extensions.Events.Dispatch will also be recorded.
</summary>
</histogram>
<histogram name="Extensions.Events.DispatchWithSuspendedEventPage" <histogram name="Extensions.Events.DispatchWithSuspendedEventPage"
enum="ExtensionEvents" expires_after="never"> enum="ExtensionEvents" expires_after="never">
<!-- expires-never: Monitoring core extensions platform behavior. --> <!-- expires-never: Monitoring core extensions platform behavior. -->
......
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