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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, | 203 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, |
204 bool is_shutdown); | 204 bool is_shutdown); |
205 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); | 205 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); |
206 | 206 |
207 // Records how much of dispatched events are handled while a Service | 207 // Records how much of dispatched events are handled while a Service |
208 // Worker is awake (i.e. after it is woken up until it gets stopped). | 208 // Worker is awake (i.e. after it is woken up until it gets stopped). |
209 static void RecordEventHandledRatio(EventType event, | 209 static void RecordEventHandledRatio(EventType event, |
210 size_t handled_events, | 210 size_t handled_events, |
211 size_t fired_events); | 211 size_t fired_events); |
212 | 212 |
| 213 // Records the time taken between sending a FetchEvent IPC from the browser |
| 214 // process to a Service Worker and executing the fetch event handler in the |
| 215 // Service Worker. |
| 216 static void RecordFetchEventDispatchingDelay(base::TimeDelta time, |
| 217 Site site_for_metrics); |
| 218 |
213 // Records the precision of the speculative launch of Service Workers for | 219 // Records the precision of the speculative launch of Service Workers for |
214 // each navigation hint type when the worker is stopped. If there was no | 220 // each navigation hint type when the worker is stopped. If there was no |
215 // main/sub frame fetch event fired on the worker, |frame_fetch_event_fired| | 221 // main/sub frame fetch event fired on the worker, |frame_fetch_event_fired| |
216 // is false. This means that the speculative launch wasn't helpful. | 222 // is false. This means that the speculative launch wasn't helpful. |
217 static void RecordNavigationHintPrecision(EventType start_worker_purpose, | 223 static void RecordNavigationHintPrecision(EventType start_worker_purpose, |
218 bool frame_fetch_event_fired); | 224 bool frame_fetch_event_fired); |
219 | 225 |
220 // Records how often a dispatched event times out. | 226 // Records how often a dispatched event times out. |
221 static void RecordEventTimeout(EventType event); | 227 static void RecordEventTimeout(EventType event); |
222 | 228 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 static void RecordStartStatusAfterFailure(int failure_count, | 277 static void RecordStartStatusAfterFailure(int failure_count, |
272 ServiceWorkerStatusCode status); | 278 ServiceWorkerStatusCode status); |
273 | 279 |
274 private: | 280 private: |
275 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 281 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
276 }; | 282 }; |
277 | 283 |
278 } // namespace content | 284 } // namespace content |
279 | 285 |
280 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 286 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
OLD | NEW |