#include "content/browser/background_sync/background_sync_metrics.h"
#include "base/metrics/histogram_functions.h"
namespace {
content::BackgroundSyncMetrics::ResultPattern EventResultToResultPattern(
bool success,
bool finished_in_foreground) { … }
const std::string GetBackgroundSyncSuffix(
blink::mojom::BackgroundSyncType sync_type) { … }
const std::string GetBackgroundSyncPrefix(
blink::mojom::BackgroundSyncType sync_type) { … }
}
namespace content {
void BackgroundSyncMetrics::RecordEventStarted(
blink::mojom::BackgroundSyncType sync_type,
bool started_in_foreground) { … }
void BackgroundSyncMetrics::RecordRegistrationComplete(
bool event_succeeded,
int num_attempts_required) { … }
void BackgroundSyncMetrics::RecordEventResult(
blink::mojom::BackgroundSyncType sync_type,
bool success,
bool finished_in_foreground) { … }
void BackgroundSyncMetrics::RecordBatchSyncEventComplete(
blink::mojom::BackgroundSyncType sync_type,
const base::TimeDelta& time,
bool from_wakeup_task,
int number_of_batched_sync_events) { … }
void BackgroundSyncMetrics::CountRegisterSuccess(
blink::mojom::BackgroundSyncType sync_type,
int64_t min_interval_ms,
RegistrationCouldFire registration_could_fire,
RegistrationIsDuplicate registration_is_duplicate) { … }
void BackgroundSyncMetrics::CountRegisterFailure(
blink::mojom::BackgroundSyncType sync_type,
BackgroundSyncStatus result) { … }
void BackgroundSyncMetrics::CountUnregisterPeriodicSync(
BackgroundSyncStatus status) { … }
void BackgroundSyncMetrics::RecordEventsFiredFromWakeupTask(
blink::mojom::BackgroundSyncType sync_type,
bool fired_events) { … }
}