chromium/components/ip_protection/common/ip_protection_telemetry_uma.cc

// Copyright 2024 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/ip_protection/common/ip_protection_telemetry_uma.h"

#include <optional>

#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "components/ip_protection/common/ip_protection_data_types.h"
#include "components/ip_protection/common/ip_protection_telemetry.h"

namespace ip_protection {

namespace {

// An enumeration of the `chain_id` values supplied in the GetProxyInfo RPC
// response, for use with `UmaHistogramEnumeration`. These values are persisted
// to logs. Entries should not be renumbered and numeric values should never be
// reused.
enum class ProxyChainId {};

// Convert a chain_id as given in `ProxyChain::ip_protection_chain_id()` into
// a value of the `ProxyChainId` enum.
ProxyChainId ChainIdToEnum(int chain_id) {}

std::string ProxyLayerToString(ProxyLayer proxy_layer) {}

}  // namespace

IpProtectionTelemetry& Telemetry() {}

void IpProtectionTelemetryUma::OAuthTokenFetchComplete(
    base::TimeDelta duration) {}

void IpProtectionTelemetryUma::TokenBatchFetchComplete(
    TryGetAuthTokensResult result,
    std::optional<base::TimeDelta> duration) {}

void IpProtectionTelemetryUma::AndroidTokenBatchFetchComplete(
    TryGetAuthTokensAndroidResult result,
    std::optional<base::TimeDelta> duration) {}

void IpProtectionTelemetryUma::ProxyChainFallback(int proxy_chain_id) {}

void IpProtectionTelemetryUma::EmptyTokenCache(ProxyLayer value) {}

void IpProtectionTelemetryUma::RequestIsEligibleForProtection(
    ProtectionEligibility value) {}

void IpProtectionTelemetryUma::ProtectionIsAvailableForRequest(
    bool are_auth_tokens_available,
    bool is_proxy_list_available) {}

void IpProtectionTelemetryUma::GetAuthTokenResultForGeo(
    bool is_token_available,
    bool enable_token_caching_by_geo,
    bool is_cache_empty,
    bool does_requested_geo_match_current) {}

void IpProtectionTelemetryUma::TokenBatchGenerationComplete(
    base::TimeDelta duration) {}

void IpProtectionTelemetryUma::GeoChangeTokenPresence(bool tokens_present) {}

void IpProtectionTelemetryUma::ProxyListRefreshComplete(
    GetProxyListResult result,
    std::optional<base::TimeDelta> duration) {}

void IpProtectionTelemetryUma::TokenSpendRate(ProxyLayer proxy_layer,
                                              int value) {}

void IpProtectionTelemetryUma::TokenExpirationRate(ProxyLayer proxy_layer,
                                                   int value) {}

void IpProtectionTelemetryUma::MdlEstimatedMemoryUsage(size_t usage) {}

}  // namespace ip_protection