| 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 case EventType::MESSAGE: | 213 case EventType::MESSAGE: |
| 212 break; | 214 break; |
| 213 | 215 |
| 214 case EventType::NUM_TYPES: | 216 case EventType::NUM_TYPES: |
| 215 NOTREACHED() << "Invalid event type"; | 217 NOTREACHED() << "Invalid event type"; |
| 216 break; | 218 break; |
| 217 } | 219 } |
| 218 } | 220 } |
| 219 | 221 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", | 278 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", |
| 277 mode, FETCH_REQUEST_MODE_LAST + 1); | 279 mode, FETCH_REQUEST_MODE_LAST + 1); |
| 278 } | 280 } |
| 279 | 281 |
| 280 void ServiceWorkerMetrics::RecordTimeBetweenEvents( | 282 void ServiceWorkerMetrics::RecordTimeBetweenEvents( |
| 281 const base::TimeDelta& time) { | 283 const base::TimeDelta& time) { |
| 282 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); | 284 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); |
| 283 } | 285 } |
| 284 | 286 |
| 285 } // namespace content | 287 } // namespace content |
| OLD | NEW |