Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: content/browser/service_worker/service_worker_metrics.cc

Issue 1133853007: Add UMA to record the ratio of how many fetch events are not handled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: size_t Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_metrics.cc
diff --git a/content/browser/service_worker/service_worker_metrics.cc b/content/browser/service_worker/service_worker_metrics.cc
index dc3c157ab2cc9310699590c828902b3d442c97b4..c582cbcaf6d55a07138338f25250b6d118645c57 100644
--- a/content/browser/service_worker/service_worker_metrics.cc
+++ b/content/browser/service_worker/service_worker_metrics.cc
@@ -107,4 +107,13 @@ void ServiceWorkerMetrics::RecordInstallEventStatus(
SERVICE_WORKER_ERROR_MAX_VALUE);
}
+void ServiceWorkerMetrics::RecordEventStatus(size_t fired_events,
+ size_t handled_events) {
+ int unhandled_ratio = 0;
+ if (handled_events > 0u)
nhiroki 2015/05/15 02:41:25 This should be |fired_events| to avoid divining by
kinuko 2015/05/15 04:42:23 Done. I'm extremely careless these days.
+ unhandled_ratio = (fired_events - handled_events) * 100.0 / fired_events;
+ UMA_HISTOGRAM_PERCENTAGE("ServiceWorker.UnhandledEventRatio",
+ unhandled_ratio);
nhiroki 2015/05/15 02:41:25 Do we need to record in the case where |fired_even
kinuko 2015/05/15 04:42:23 Done.
+}
+
} // namespace content
« no previous file with comments | « content/browser/service_worker/service_worker_metrics.h ('k') | content/browser/service_worker/service_worker_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698