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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_metrics.h" 5 #include "content/browser/service_worker/service_worker_metrics.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/user_metrics_action.h" 8 #include "base/metrics/user_metrics_action.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/content_browser_client.h" 10 #include "content/public/browser/content_browser_client.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.ActivateEventStatus", status, 100 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.ActivateEventStatus", status,
101 SERVICE_WORKER_ERROR_MAX_VALUE); 101 SERVICE_WORKER_ERROR_MAX_VALUE);
102 } 102 }
103 103
104 void ServiceWorkerMetrics::RecordInstallEventStatus( 104 void ServiceWorkerMetrics::RecordInstallEventStatus(
105 ServiceWorkerStatusCode status) { 105 ServiceWorkerStatusCode status) {
106 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.InstallEventStatus", status, 106 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.InstallEventStatus", status,
107 SERVICE_WORKER_ERROR_MAX_VALUE); 107 SERVICE_WORKER_ERROR_MAX_VALUE);
108 } 108 }
109 109
110 void ServiceWorkerMetrics::RecordEventStatus(size_t fired_events,
111 size_t handled_events) {
112 int unhandled_ratio = 0;
113 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.
114 unhandled_ratio = (fired_events - handled_events) * 100.0 / fired_events;
115 UMA_HISTOGRAM_PERCENTAGE("ServiceWorker.UnhandledEventRatio",
116 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.
117 }
118
110 } // namespace content 119 } // namespace content
OLDNEW
« 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