#include <string_view>
#include "services/network/trust_tokens/trust_token_operation_metrics_recorder.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/string_util.h"
#include "services/network/public/mojom/trust_tokens.mojom-shared.h"
namespace network {
namespace internal {
const char kTrustTokenTotalTimeHistogramNameBase[] = …;
const char kTrustTokenFinalizeTimeHistogramNameBase[] = …;
const char kTrustTokenBeginTimeHistogramNameBase[] = …;
const char kTrustTokenServerTimeHistogramNameBase[] = …;
}
namespace {
std::string_view StatusToSuccessOrFailure(
mojom::TrustTokenOperationStatus status) { … }
std::string_view TypeToString(mojom::TrustTokenOperationType type) { … }
const char kHistogramPartsSeparator[] = …;
}
TrustTokenOperationMetricsRecorder::TrustTokenOperationMetricsRecorder(
mojom::TrustTokenOperationType type)
: … { … }
TrustTokenOperationMetricsRecorder::~TrustTokenOperationMetricsRecorder() =
default;
void TrustTokenOperationMetricsRecorder::BeginBegin() { … }
void TrustTokenOperationMetricsRecorder::FinishBegin(
mojom::TrustTokenOperationStatus status) { … }
void TrustTokenOperationMetricsRecorder::BeginFinalize() { … }
void TrustTokenOperationMetricsRecorder::FinishFinalize(
mojom::TrustTokenOperationStatus status) { … }
void HistogramTrustTokenOperationNetError(
network::mojom::TrustTokenOperationType type,
network::mojom::TrustTokenOperationStatus status,
int net_error) { … }
}