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

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: 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(unsigned int fired_events,
111 unsigned int handled_events) {
112 int unhandled_ratio = static_cast<double>(fired_events - handled_events) *
113 100.0 / static_cast<double>(fired_events);
Alexei Svitkine (slow) 2015/05/14 17:49:59 Nit: I don't think you actually need the double ca
kinuko 2015/05/15 00:05:37 Done.
114 UMA_HISTOGRAM_PERCENTAGE("ServiceWorker.UnhandledEventRatio",
115 unhandled_ratio);
116 }
117
110 } // namespace content 118 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698