Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/background_sync/background_sync_metrics.h" | |
| 6 | |
| 7 #include "base/metrics/histogram_macros.h" | |
| 8 #include "base/metrics/user_metrics_action.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 void BackgroundSyncMetrics::RecordEventResult(SyncPeriodicity periodicity, | |
| 13 bool result) { | |
| 14 switch (periodicity) { | |
| 15 case SYNC_ONE_SHOT: | |
| 16 UMA_HISTOGRAM_BOOLEAN("BackgroundSync.Event.OneShotResult", result); | |
| 17 return; | |
| 18 case SYNC_PERIODIC: | |
| 19 UMA_HISTOGRAM_BOOLEAN("BackgroundSync.Event.PeriodicResult", result); | |
| 20 return; | |
| 21 } | |
| 22 NOTREACHED(); | |
| 23 } | |
| 24 | |
| 25 void BackgroundSyncMetrics::RecordSyncEventHandlingTime( | |
| 26 const base::TimeDelta& time) { | |
| 27 UMA_HISTOGRAM_MEDIUM_TIMES("BackgroundSync.Event.Time", time); | |
|
jkarlin
2015/07/13 16:51:13
MEDIUM_TIMES goes from 10ms to 3 minutes. We shoul
iclelland
2015/07/13 19:34:31
Thanks -- I meant go back to check that.
Done.
| |
| 28 } | |
| 29 | |
| 30 void BackgroundSyncMetrics::CountRegistration(SyncPeriodicity periodicity, | |
| 31 bool could_fire, | |
| 32 RegistrationResult result) { | |
| 33 switch (periodicity) { | |
| 34 case SYNC_ONE_SHOT: | |
| 35 UMA_HISTOGRAM_ENUMERATION("BackgroundSync.Registration.OneShot", result, | |
| 36 NUM_REGISTRATION_RESULT_TYPES); | |
| 37 UMA_HISTOGRAM_BOOLEAN("BackgroundSync.Registration.OneShot.CouldFire", | |
| 38 could_fire); | |
| 39 return; | |
| 40 case SYNC_PERIODIC: | |
| 41 UMA_HISTOGRAM_ENUMERATION("BackgroundSync.Registration.Periodic", result, | |
| 42 NUM_REGISTRATION_RESULT_TYPES); | |
| 43 UMA_HISTOGRAM_BOOLEAN("BackgroundSync.Registration.Periodic.CouldFire", | |
| 44 could_fire); | |
| 45 return; | |
| 46 } | |
| 47 NOTREACHED(); | |
| 48 } | |
| 49 | |
| 50 void BackgroundSyncMetrics::CountUnregistration(SyncPeriodicity periodicity, | |
| 51 bool success) { | |
| 52 switch (periodicity) { | |
| 53 case SYNC_ONE_SHOT: | |
| 54 UMA_HISTOGRAM_BOOLEAN("BackgroundSync.Unregistration.OneShot", success); | |
| 55 return; | |
| 56 case SYNC_PERIODIC: | |
| 57 UMA_HISTOGRAM_BOOLEAN("BackgroundSync.Unregistration.Periodic", success); | |
| 58 return; | |
| 59 } | |
| 60 NOTREACHED(); | |
| 61 } | |
| 62 | |
| 63 } // namespace content | |
| OLD | NEW |