| 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/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "content/common/service_worker/service_worker_types.h" | 10 #include "content/common/service_worker/service_worker_types.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 time); | 200 time); |
| 201 break; | 201 break; |
| 202 case EventType::PUSH: | 202 case EventType::PUSH: |
| 203 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time); | 203 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time); |
| 204 break; | 204 break; |
| 205 | 205 |
| 206 // Event duration for fetch is recorded separately. | 206 // Event duration for fetch is recorded separately. |
| 207 case EventType::FETCH: | 207 case EventType::FETCH: |
| 208 // For now event duration for these events is not recorded. | 208 // For now event duration for these events is not recorded. |
| 209 case EventType::GEOFENCING: | 209 case EventType::GEOFENCING: |
| 210 // TODO(nsatragno): create UMA metric. |
| 211 case EventType::NOTIFICATION_CLOSE: |
| 210 case EventType::SERVICE_PORT_CONNECT: | 212 case EventType::SERVICE_PORT_CONNECT: |
| 211 break; | 213 break; |
| 212 | 214 |
| 213 case EventType::NUM_TYPES: | 215 case EventType::NUM_TYPES: |
| 214 NOTREACHED() << "Invalid event type"; | 216 NOTREACHED() << "Invalid event type"; |
| 215 break; | 217 break; |
| 216 } | 218 } |
| 217 } | 219 } |
| 218 | 220 |
| 219 void ServiceWorkerMetrics::RecordFetchEventStatus( | 221 void ServiceWorkerMetrics::RecordFetchEventStatus( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", | 277 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", |
| 276 mode, FETCH_REQUEST_MODE_LAST + 1); | 278 mode, FETCH_REQUEST_MODE_LAST + 1); |
| 277 } | 279 } |
| 278 | 280 |
| 279 void ServiceWorkerMetrics::RecordTimeBetweenEvents( | 281 void ServiceWorkerMetrics::RecordTimeBetweenEvents( |
| 280 const base::TimeDelta& time) { | 282 const base::TimeDelta& time) { |
| 281 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); | 283 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); |
| 282 } | 284 } |
| 283 | 285 |
| 284 } // namespace content | 286 } // namespace content |
| OLD | NEW |