#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 {
enum class ProxyChainId { … };
ProxyChainId ChainIdToEnum(int chain_id) { … }
std::string ProxyLayerToString(ProxyLayer proxy_layer) { … }
}
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) { … }
}