chromium/components/image_fetcher/core/image_fetcher_metrics_reporter.cc

// Copyright 2018 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/image_fetcher/core/image_fetcher_metrics_reporter.h"

#include "base/metrics/histogram.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/numerics/clamped_math.h"

namespace image_fetcher {

const char
    ImageFetcherMetricsReporter::kCachedImageFetcherInternalUmaClientName[] =;

namespace {

// 10 seconds in milliseconds.
const int kMaxReportTimeMs =;
const int kMaxCacheSizeKb =; /* 300MB */
const int kMaxCacheMetadataCount =;

constexpr char kEventsHistogram[] =;
constexpr char kImageLoadFromCacheHistogram[] =;
constexpr char kImageLoadFromCacheJavaHistogram[] =;
constexpr char kTotalFetchFromNativeTimeJavaHistogram[] =;
constexpr char kImageLoadFromNetworkHistogram[] =;
constexpr char kImageLoadFromNetworkAfterCacheHitHistogram[] =;
constexpr char kTimeSinceLastLRUEvictionHistogram[] =;
constexpr char kLoadImageMetadata[] =;
constexpr char kNetworkRequestStatusCodes[] =;
constexpr char kImageCacheSize[] =;
constexpr char kImageCacheMetadataCount[] =;

// Returns a raw pointer to a histogram which is owned
base::HistogramBase* GetTimeHistogram(const std::string& histogram_name,
                                      const std::string client_name) {}

// Appends the cache strategy suffix. Needs to match ImageFetcherCacheStrategy
// in histograms.xml.
void AppendSuffix(CacheOption cache_option, std::string* name) {}

}  // namespace

// static
void ImageFetcherMetricsReporter::ReportEvent(const std::string& client_name,
                                              ImageFetcherEvent event) {}

// static
void ImageFetcherMetricsReporter::ReportImageLoadFromCacheTime(
    const std::string& client_name,
    base::Time start_time) {}

// static
void ImageFetcherMetricsReporter::ReportImageLoadFromCacheTimeJava(
    const std::string& client_name,
    base::Time start_time) {}

// static
void ImageFetcherMetricsReporter::ReportTotalFetchFromNativeTimeJava(
    const std::string& client_name,
    base::Time start_time) {}

// static
void ImageFetcherMetricsReporter::ReportImageLoadFromNetworkTime(
    const std::string& client_name,
    base::Time start_time) {}

// static
void ImageFetcherMetricsReporter::ReportImageLoadFromNetworkAfterCacheHit(
    const std::string& client_name,
    base::Time start_time) {}

// static
void ImageFetcherMetricsReporter::ReportTimeSinceLastCacheLRUEviction(
    base::Time start_time) {}

// static
void ImageFetcherMetricsReporter::ReportLoadImageMetadata(
    base::TimeTicks start_time) {}

// static
void ImageFetcherMetricsReporter::ReportRequestStatusCode(
    const std::string& client_name,
    int code) {}

// static
void ImageFetcherMetricsReporter::ReportCacheStatus(CacheOption cache_option,
                                                    size_t total_bytes,
                                                    int metadata_count) {}

}  // namespace image_fetcher