OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |