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

Side by Side Diff: content/browser/service_worker/service_worker_metrics.cc

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits Created 4 years, 10 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/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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 case EventType::ACTIVATE: 51 case EventType::ACTIVATE:
52 return "Activate"; 52 return "Activate";
53 case EventType::INSTALL: 53 case EventType::INSTALL:
54 return "Install"; 54 return "Install";
55 case EventType::FETCH: 55 case EventType::FETCH:
56 return "Fetch"; 56 return "Fetch";
57 case EventType::SYNC: 57 case EventType::SYNC:
58 return "Sync"; 58 return "Sync";
59 case EventType::NOTIFICATION_CLICK: 59 case EventType::NOTIFICATION_CLICK:
60 return "Notification Click"; 60 return "Notification Click";
61 case EventType::NOTIFICATION_CLOSE:
62 return "Notification Close";
61 case EventType::PUSH: 63 case EventType::PUSH:
62 return "Push"; 64 return "Push";
63 case EventType::GEOFENCING: 65 case EventType::GEOFENCING:
64 return "Geofencing"; 66 return "Geofencing";
65 case EventType::SERVICE_PORT_CONNECT: 67 case EventType::SERVICE_PORT_CONNECT:
66 return "Service Port Connect"; 68 return "Service Port Connect";
67 case EventType::MESSAGE: 69 case EventType::MESSAGE:
68 return "Message"; 70 return "Message";
69 case EventType::NUM_TYPES: 71 case EventType::NUM_TYPES:
70 break; 72 break;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.InstallEvent.Time", time); 221 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.InstallEvent.Time", time);
220 break; 222 break;
221 case EventType::SYNC: 223 case EventType::SYNC:
222 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.BackgroundSyncEvent.Time", 224 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.BackgroundSyncEvent.Time",
223 time); 225 time);
224 break; 226 break;
225 case EventType::NOTIFICATION_CLICK: 227 case EventType::NOTIFICATION_CLICK:
226 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NotificationClickEvent.Time", 228 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NotificationClickEvent.Time",
227 time); 229 time);
228 break; 230 break;
231 case EventType::NOTIFICATION_CLOSE:
232 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.NotificationCloseEvent.Time",
233 time);
234 break;
229 case EventType::PUSH: 235 case EventType::PUSH:
230 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time); 236 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.PushEvent.Time", time);
231 break; 237 break;
232 case EventType::MESSAGE: 238 case EventType::MESSAGE:
233 // TODO(nhiroki): Record event duration for Message event after 239 // TODO(nhiroki): Record event duration for Message event after
234 // ExtendableMessageEvent is enabled by default (crbug.com/543198). 240 // ExtendableMessageEvent is enabled by default (crbug.com/543198).
235 break; 241 break;
236 242
237 // Event duration for fetch is recorded separately. 243 // Event duration for fetch is recorded separately.
238 case EventType::FETCH: 244 case EventType::FETCH:
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode", 312 UMA_HISTOGRAM_ENUMERATION("ServiceWorker.URLRequestJob.FallbackedRequestMode",
307 mode, FETCH_REQUEST_MODE_LAST + 1); 313 mode, FETCH_REQUEST_MODE_LAST + 1);
308 } 314 }
309 315
310 void ServiceWorkerMetrics::RecordTimeBetweenEvents( 316 void ServiceWorkerMetrics::RecordTimeBetweenEvents(
311 const base::TimeDelta& time) { 317 const base::TimeDelta& time) {
312 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time); 318 UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.TimeBetweenEvents", time);
313 } 319 }
314 320
315 } // namespace content 321 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_metrics.h ('k') | content/common/service_worker/service_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698