#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 {
const int kMaxReportTimeMs = …;
const int kMaxCacheSizeKb = …;
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[] = …;
base::HistogramBase* GetTimeHistogram(const std::string& histogram_name,
const std::string client_name) { … }
void AppendSuffix(CacheOption cache_option, std::string* name) { … }
}
void ImageFetcherMetricsReporter::ReportEvent(const std::string& client_name,
ImageFetcherEvent event) { … }
void ImageFetcherMetricsReporter::ReportImageLoadFromCacheTime(
const std::string& client_name,
base::Time start_time) { … }
void ImageFetcherMetricsReporter::ReportImageLoadFromCacheTimeJava(
const std::string& client_name,
base::Time start_time) { … }
void ImageFetcherMetricsReporter::ReportTotalFetchFromNativeTimeJava(
const std::string& client_name,
base::Time start_time) { … }
void ImageFetcherMetricsReporter::ReportImageLoadFromNetworkTime(
const std::string& client_name,
base::Time start_time) { … }
void ImageFetcherMetricsReporter::ReportImageLoadFromNetworkAfterCacheHit(
const std::string& client_name,
base::Time start_time) { … }
void ImageFetcherMetricsReporter::ReportTimeSinceLastCacheLRUEviction(
base::Time start_time) { … }
void ImageFetcherMetricsReporter::ReportLoadImageMetadata(
base::TimeTicks start_time) { … }
void ImageFetcherMetricsReporter::ReportRequestStatusCode(
const std::string& client_name,
int code) { … }
void ImageFetcherMetricsReporter::ReportCacheStatus(CacheOption cache_option,
size_t total_bytes,
int metadata_count) { … }
}