#include "components/download/internal/background_service/stats.h"
#include <map>
#include "base/files/file_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "components/download/internal/background_service/startup_status.h"
#include "components/download/public/background_service/clients.h"
namespace download {
namespace stats {
namespace {
const int64_t kMaxFileSizeKB = …;
enum class PauseReason { … };
std::string TaskTypeToHistogramSuffix(DownloadTaskType task_type) { … }
std::string FileCleanupReasonToHistogramSuffix(FileCleanupReason reason) { … }
void LogDownloadPauseReason(PauseReason reason, bool on_upload_data_received) { … }
}
void LogControllerStartupStatus(bool in_recovery, const StartupStatus& status) { … }
void LogStartUpResult(bool in_recovery, StartUpResult result) { … }
void LogServiceApiAction(DownloadClient client, ServiceApiAction action) { … }
void LogStartDownloadResult(DownloadClient client,
DownloadParams::StartResult result) { … }
void LogDownloadCompletion(DownloadClient client,
CompletionType type,
uint64_t file_size_bytes) { … }
void LogDownloadPauseReason(const DownloadBlockageStatus& blockage_status,
bool currently_in_progress) { … }
void LogScheduledTaskStatus(DownloadTaskType task_type,
ScheduledTaskStatus status) { … }
void LogsFileDirectoryCreationError(base::File::Error error) { … }
void LogFileCleanupStatus(FileCleanupReason reason,
int succeeded_cleanups,
int failed_cleanups,
int external_cleanups) { … }
void LogFileLifeTime(const base::TimeDelta& file_life_time) { … }
void LogEntryEvent(DownloadEvent event) { … }
void LogEntryRetryCount(uint32_t retry_count) { … }
}
}