chromium/components/download/internal/background_service/stats.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// The maximum tracked file size in KB, larger files will fall into overflow
// bucket.
const int64_t kMaxFileSizeKB =; /* 4GB */

// Enum used by UMA metrics to track various reasons of pausing a download.
enum class PauseReason {};

// Converts DownloadTaskType to histogram suffix.
// Should maps to suffix string in histograms.xml.
std::string TaskTypeToHistogramSuffix(DownloadTaskType task_type) {}

// Converts FileCleanupReason to histogram suffix.
// Should maps to suffix string in histograms.xml.
std::string FileCleanupReasonToHistogramSuffix(FileCleanupReason reason) {}

// Helper method to log the pause reason for a particular download.
void LogDownloadPauseReason(PauseReason reason, bool on_upload_data_received) {}

}  // namespace

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) {}

}  // namespace stats
}  // namespace download