| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 static void RecordStartWorkerTime(base::TimeDelta time, | 159 static void RecordStartWorkerTime(base::TimeDelta time, |
| 160 bool is_installed, | 160 bool is_installed, |
| 161 StartSituation start_situation); | 161 StartSituation start_situation); |
| 162 | 162 |
| 163 // Records the result of trying to stop a worker. | 163 // Records the result of trying to stop a worker. |
| 164 static void RecordWorkerStopped(StopStatus status); | 164 static void RecordWorkerStopped(StopStatus status); |
| 165 | 165 |
| 166 // Records the time taken to successfully stop a worker. | 166 // Records the time taken to successfully stop a worker. |
| 167 static void RecordStopWorkerTime(base::TimeDelta time); | 167 static void RecordStopWorkerTime(base::TimeDelta time); |
| 168 | 168 |
| 169 static void RecordActivateEventStatus(ServiceWorkerStatusCode status); | 169 static void RecordActivateEventStatus(ServiceWorkerStatusCode status, |
| 170 bool is_shutdown); |
| 170 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); | 171 static void RecordInstallEventStatus(ServiceWorkerStatusCode status); |
| 171 | 172 |
| 172 // Records how much of dispatched events are handled while a Service | 173 // Records how much of dispatched events are handled while a Service |
| 173 // Worker is awake (i.e. after it is woken up until it gets stopped). | 174 // Worker is awake (i.e. after it is woken up until it gets stopped). |
| 174 static void RecordEventHandledRatio(EventType event, | 175 static void RecordEventHandledRatio(EventType event, |
| 175 size_t handled_events, | 176 size_t handled_events, |
| 176 size_t fired_events); | 177 size_t fired_events); |
| 177 | 178 |
| 178 // Records how often a dispatched event times out. | 179 // Records how often a dispatched event times out. |
| 179 static void RecordEventTimeout(EventType event); | 180 static void RecordEventTimeout(EventType event); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 static void RecordStartStatusAfterFailure(int failure_count, | 230 static void RecordStartStatusAfterFailure(int failure_count, |
| 230 ServiceWorkerStatusCode status); | 231 ServiceWorkerStatusCode status); |
| 231 | 232 |
| 232 private: | 233 private: |
| 233 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); | 234 DISALLOW_IMPLICIT_CONSTRUCTORS(ServiceWorkerMetrics); |
| 234 }; | 235 }; |
| 235 | 236 |
| 236 } // namespace content | 237 } // namespace content |
| 237 | 238 |
| 238 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ | 239 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_METRICS_H_ |
| OLD | NEW |