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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.BackgroundSyncEvent.Time", | 222 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.BackgroundSyncEvent.Time", |
223 time); | 223 time); |
224 break; | 224 break; |
225 case EventType::NOTIFICATION_CLICK: | 225 case EventType::NOTIFICATION_CLICK: |
226 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NotificationClickEvent.Time", | 226 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NotificationClickEvent.Time", |
227 time); | 227 time); |
228 break; | 228 break; |
229 case EventType::PUSH: | 229 case EventType::PUSH: |
230 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time); | 230 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time); |
231 break; | 231 break; |
| 232 case EventType::MESSAGE: |
| 233 // TODO(nhiroki): Record event duration for Message event after |
| 234 // ExtendableMessageEvent is enabled by default (crbug.com/543198). |
| 235 break; |
232 | 236 |
233 // Event duration for fetch is recorded separately. | 237 // Event duration for fetch is recorded separately. |
234 case EventType::FETCH: | 238 case EventType::FETCH: |
235 // For now event duration for these events is not recorded. | 239 // For now event duration for these events is not recorded. |
236 case EventType::GEOFENCING: | 240 case EventType::GEOFENCING: |
237 case EventType::SERVICE_PORT_CONNECT: | 241 case EventType::SERVICE_PORT_CONNECT: |
238 case EventType::MESSAGE: | |
239 break; | 242 break; |
240 | 243 |
241 case EventType::NUM_TYPES: | 244 case EventType::NUM_TYPES: |
242 NOTREACHED() << "Invalid event type"; | 245 NOTREACHED() << "Invalid event type"; |
243 break; | 246 break; |
244 } | 247 } |
245 } | 248 } |
246 | 249 |
247 void ServiceWorkerMetrics::RecordFetchEventStatus( | 250 void ServiceWorkerMetrics::RecordFetchEventStatus( |
248 bool is_main_resource, | 251 bool is_main_resource, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", | 306 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", |
304 mode, FETCH_REQUEST_MODE_LAST + 1); | 307 mode, FETCH_REQUEST_MODE_LAST + 1); |
305 } | 308 } |
306 | 309 |
307 void ServiceWorkerMetrics::RecordTimeBetweenEvents( | 310 void ServiceWorkerMetrics::RecordTimeBetweenEvents( |
308 const base::TimeDelta& time) { | 311 const base::TimeDelta& time) { |
309 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); | 312 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); |
310 } | 313 } |
311 | 314 |
312 } // namespace content | 315 } // namespace content |
OLD | NEW |