chromium/base/metrics/statistics_recorder.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/metrics/statistics_recorder.h"

#include <string_view>

#include "base/at_exit.h"
#include "base/barrier_closure.h"
#include "base/containers/contains.h"
#include "base/debug/leak_annotations.h"
#include "base/json/string_escape.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_snapshot_manager.h"
#include "base/metrics/metrics_hashes.h"
#include "base/metrics/persistent_histogram_allocator.h"
#include "base/metrics/record_histogram_checker.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "build/build_config.h"

namespace base {
namespace {

bool HistogramNameLesser(const base::HistogramBase* a,
                         const base::HistogramBase* b) {}

}  // namespace

// static
LazyInstance<Lock>::Leaky StatisticsRecorder::lock_ =;

// static
LazyInstance<Lock>::Leaky StatisticsRecorder::snapshot_lock_ =;

// static
StatisticsRecorder::SnapshotTransactionId
    StatisticsRecorder::last_snapshot_transaction_id_ =;

// static
StatisticsRecorder* StatisticsRecorder::top_ =;

// static
bool StatisticsRecorder::is_vlog_initialized_ =;

// static
std::atomic<bool> StatisticsRecorder::have_active_callbacks_{};

// static
std::atomic<StatisticsRecorder::GlobalSampleCallback>
    StatisticsRecorder::global_sample_callback_{};

StatisticsRecorder::ScopedHistogramSampleObserver::
    ScopedHistogramSampleObserver(const std::string& name,
                                  OnSampleCallback callback)
    :{}

StatisticsRecorder::ScopedHistogramSampleObserver::
    ~ScopedHistogramSampleObserver() {}

void StatisticsRecorder::ScopedHistogramSampleObserver::RunCallback(
    const char* histogram_name,
    uint64_t name_hash,
    HistogramBase::Sample sample) {}

StatisticsRecorder::~StatisticsRecorder() {}

// static
void StatisticsRecorder::EnsureGlobalRecorderWhileLocked() {}

// static
void StatisticsRecorder::RegisterHistogramProvider(
    const WeakPtr<HistogramProvider>& provider) {}

// static
HistogramBase* StatisticsRecorder::RegisterOrDeleteDuplicate(
    HistogramBase* histogram) {}

// static
const BucketRanges* StatisticsRecorder::RegisterOrDeleteDuplicateRanges(
    const BucketRanges* ranges) {}

// static
void StatisticsRecorder::WriteGraph(const std::string& query,
                                    std::string* output) {}

// static
std::string StatisticsRecorder::ToJSON(JSONVerbosityLevel verbosity_level) {}

// static
std::vector<const BucketRanges*> StatisticsRecorder::GetBucketRanges() {}

// static
HistogramBase* StatisticsRecorder::FindHistogram(std::string_view name) {}

// static
StatisticsRecorder::HistogramProviders
StatisticsRecorder::GetHistogramProviders() {}

// static
void StatisticsRecorder::ImportProvidedHistograms(bool async,
                                                  OnceClosure done_callback) {}

// static
void StatisticsRecorder::ImportProvidedHistogramsSync() {}

// static
StatisticsRecorder::SnapshotTransactionId StatisticsRecorder::PrepareDeltas(
    bool include_persistent,
    HistogramBase::Flags flags_to_set,
    HistogramBase::Flags required_flags,
    HistogramSnapshotManager* snapshot_manager) {}

// static
StatisticsRecorder::SnapshotTransactionId
StatisticsRecorder::SnapshotUnloggedSamples(
    HistogramBase::Flags required_flags,
    HistogramSnapshotManager* snapshot_manager) {}

// static
StatisticsRecorder::SnapshotTransactionId
StatisticsRecorder::GetLastSnapshotTransactionId() {}

// static
void StatisticsRecorder::InitLogOnShutdown() {}

HistogramBase* StatisticsRecorder::FindHistogramByHashInternal(
    uint64_t hash,
    std::string_view name) const {}

// static
void StatisticsRecorder::AddHistogramSampleObserver(
    const std::string& name,
    StatisticsRecorder::ScopedHistogramSampleObserver* observer) {}

// static
void StatisticsRecorder::RemoveHistogramSampleObserver(
    const std::string& name,
    StatisticsRecorder::ScopedHistogramSampleObserver* observer) {}

// static
void StatisticsRecorder::FindAndRunHistogramCallbacks(
    base::PassKey<HistogramBase>,
    const char* histogram_name,
    uint64_t name_hash,
    HistogramBase::Sample sample) {}

// static
void StatisticsRecorder::SetGlobalSampleCallback(
    const GlobalSampleCallback& new_global_sample_callback) {}

// static
size_t StatisticsRecorder::GetHistogramCount() {}

// static
void StatisticsRecorder::ForgetHistogramForTesting(std::string_view name) {}

// static
std::unique_ptr<StatisticsRecorder>
StatisticsRecorder::CreateTemporaryForTesting() {}

// static
void StatisticsRecorder::SetRecordChecker(
    std::unique_ptr<RecordHistogramChecker> record_checker) {}

// static
bool StatisticsRecorder::ShouldRecordHistogram(uint32_t histogram_hash) {}

// static
StatisticsRecorder::Histograms StatisticsRecorder::GetHistograms(
    bool include_persistent) {}

// static
StatisticsRecorder::Histograms StatisticsRecorder::Sort(Histograms histograms) {}

// static
StatisticsRecorder::Histograms StatisticsRecorder::WithName(
    Histograms histograms,
    const std::string& query,
    bool case_sensitive) {}

// static
void StatisticsRecorder::ImportGlobalPersistentHistograms() {}

StatisticsRecorder::StatisticsRecorder() {}

// static
void StatisticsRecorder::InitLogOnShutdownWhileLocked() {}

}  // namespace base