| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_ | 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_ |
| 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_ | 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/background_sync/background_sync.pb.h" | 10 #include "content/browser/background_sync/background_sync.pb.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Records the result of a single sync event firing. | 31 // Records the result of a single sync event firing. |
| 32 static void RecordEventResult(SyncPeriodicity periodicity, | 32 static void RecordEventResult(SyncPeriodicity periodicity, |
| 33 bool result, | 33 bool result, |
| 34 bool finished_in_foreground); | 34 bool finished_in_foreground); |
| 35 | 35 |
| 36 // Records the result of running a batch of sync events, including the total | 36 // Records the result of running a batch of sync events, including the total |
| 37 // time spent, and the batch size. | 37 // time spent, and the batch size. |
| 38 static void RecordBatchSyncEventComplete(const base::TimeDelta& time, | 38 static void RecordBatchSyncEventComplete(const base::TimeDelta& time, |
| 39 int number_of_batched_sync_events); | 39 int number_of_batched_sync_events); |
| 40 | 40 |
| 41 // Records the result of trying to register a sync. |could_fire| indicates | 41 // Records the result of successfully registering a sync. |could_fire| |
| 42 // whether the conditions were sufficient for the sync to fire immediately at | 42 // indicates whether the conditions were sufficient for the sync to fire |
| 43 // the time it was registered. | 43 // immediately at the time it was registered. |
| 44 static void CountRegister(SyncPeriodicity periodicity, | 44 static void CountRegisterSuccess( |
| 45 RegistrationCouldFire could_fire, | 45 SyncPeriodicity periodicity, |
| 46 RegistrationIsDuplicate registration_is_duplicate, | 46 RegistrationCouldFire could_fire, |
| 47 BackgroundSyncStatus result); | 47 RegistrationIsDuplicate registration_is_duplicate); |
| 48 |
| 49 // Records the status of a failed sync registration. |
| 50 static void CountRegisterFailure(SyncPeriodicity periodicity, |
| 51 BackgroundSyncStatus status); |
| 48 | 52 |
| 49 // Records the result of trying to unregister a sync. | 53 // Records the result of trying to unregister a sync. |
| 50 static void CountUnregister(SyncPeriodicity periodicity, | 54 static void CountUnregister(SyncPeriodicity periodicity, |
| 51 BackgroundSyncStatus result); | 55 BackgroundSyncStatus result); |
| 52 | 56 |
| 53 private: | 57 private: |
| 54 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundSyncMetrics); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundSyncMetrics); |
| 55 }; | 59 }; |
| 56 | 60 |
| 57 } // namespace content | 61 } // namespace content |
| 58 | 62 |
| 59 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_ | 63 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_ |
| OLD | NEW |