Skip to main content

chronon::observe::CounterRegistry

#include <CounterRegistry.hpp>

Public Classes

Name
structCounterKeyHash
structCounterKey

Public Functions

Name
const std::vector< CounterSnapshotPlanMetadata > &snapshotPlans() const
voidreregisterAll(const std::vector< std::unique_ptr< ObservationContext > > & contexts)
voidregisterCounter(const std::string & unit_name, CounterId id, SimpleCounter * counter_ptr, const std::string & counter_name ="")
boolpushOwnerSnapshots(uint64_t cycle, std::span< const size_t > owner_ids, ThreadContext & thread_context)
uint64_tnextOwnerSnapshotCycle(size_t owner_id, uint64_t run_start, uint64_t period) const
voiddumpFinalSnapshot(uint64_t cycle, ObservationQueue * queue, const std::vector< std::unique_ptr< ObservationContext > > & contexts)
const std::vector< DerivedCounterDef > &derivedDefs() const
const std::vector< CounterSnapshotEntryMetadata > &counterColumns() const
voidclear()

Public Functions Documentation

function snapshotPlans

inline const std::vector< CounterSnapshotPlanMetadata > & snapshotPlans() const

function reregisterAll

void reregisterAll(
const std::vector< std::unique_ptr< ObservationContext > > & contexts
)

function registerCounter

inline void registerCounter(
const std::string & unit_name,
CounterId id,
SimpleCounter * counter_ptr,
const std::string & counter_name =""
)

function pushOwnerSnapshots

bool pushOwnerSnapshots(
uint64_t cycle,
std::span< const size_t > owner_ids,
ThreadContext & thread_context
)

Push and reset counters owned by the supplied scheduler clusters.

The caller must be the sole writer for every owner in owner_ids. Metadata and record sizes are precomputed by reregisterAll(), so this path performs no allocation and writes only to the caller's SPSC queue.

function nextOwnerSnapshotCycle

uint64_t nextOwnerSnapshotCycle(
size_t owner_id,
uint64_t run_start,
uint64_t period
) const

Return the next nominal periodic cycle for one stable scheduler owner.

The returned state follows the owner across worker migration. No counter storage is accessed, and the query is lock-free.

function dumpFinalSnapshot

void dumpFinalSnapshot(
uint64_t cycle,
ObservationQueue * queue,
const std::vector< std::unique_ptr< ObservationContext > > & contexts
)

function derivedDefs

inline const std::vector< DerivedCounterDef > & derivedDefs() const

function counterColumns

inline const std::vector< CounterSnapshotEntryMetadata > & counterColumns() const

function clear

inline void clear()

Updated on 2026-07-23 at 16:24:33 +0000