Skip to main content

chronon::observe

Namespaces

Name
chronon::observe::simd
chronon::observe::category
chronon::observe::DerivedFormula
Convenience formulas for common derived-counter patterns.

Classes

Name
structchronon::observe::ArgTypeOf< uint8_t >
structchronon::observe::ArgTypeOf< uint64_t >
structchronon::observe::ArgTypeOf< uint32_t >
structchronon::observe::ArgTypeOf< uint16_t >
structchronon::observe::ArgTypeOf< int8_t >
structchronon::observe::ArgTypeOf< int64_t >
structchronon::observe::ArgTypeOf< int32_t >
structchronon::observe::ArgTypeOf< int16_t >
structchronon::observe::ArgTypeOf< float >
structchronon::observe::ArgTypeOf< double >
structchronon::observe::ArgTypeOf< const char * >
structchronon::observe::ArgTypeOf< char * >
structchronon::observe::ArgTypeOf< bool >
structchronon::observe::ArgTypeOf< T * >
structchronon::observe::ArgTypeOf
Maps a C++ type to its ArgType.
structchronon::observe::ArenaSnapshot
Copy of the arena region referenced by a batch of flushed records.

Types

Name
enum class uint8_tOutputFormat { Text, Both, Binary}
How an event channel writes its output.
enum class uint8_tObservationChannel { Warn = 3, Trace = 0, NumChannels = 5, Info = 2, Error = 4, Debug = 1}
Identifies the observation channel for per-unit stats tracking.
enum class uint8_tObservationChannel { }
Identifies the observation channel for per-unit stats tracking.
enum class uint8_tLogLevel { Warn = 2, Info = 1, Error = 3, Debug = 0}
using uint32_tFormatId
Compile-time format-string registration for zero-copy trace/log.
enum class uint32_tCounterId { }
Strongly typed counter identifier; indexes into the counter storage array.
enum class uint8_tCounterCsvFormat { Pivoted, Long}
Counter CSV layout.
using std::function< double(std::span< const uint64_t >)>ComputeFn
using uint64_tCategoryMask
Bitmask for observability categories.
enum class uint8_tBackpressurePolicy { SpinWait, Drop, BoundedWait}
Producer behavior when SPSC queues are full.
enum class uint8_tArgType { UInt8, UInt64, UInt32, UInt16, String, Pointer, None = 0, Int8, Int64, Int32, Int16, Float, Double, Bool}

Functions

Name
template <FixedString Fmt,typename Cat ,typename... Args>
void
tracePipe(ObservationContext * , Cat , const char * , Args && ...)
template <FixedString Fmt,typename Cat ,typename... Args>
void
traceEvent(ObservationContext * , Cat , Args && ...)
voidtraceCounter(ObservationContext * , const char * , int64_t )
template <FixedString Fmt,typename Cat ,typename... Args>
void
trace(ObservationContext * ctx, Cat category, Args &&... args)
Emit a trace event with compile-time format string.
uint32_ttoIndex(CounterId id)
CounterIdmakeCounterId(uint32_t value)
template <FixedString Fmt,typename... Args>
void
log_warn(ObservationContext * ctx, Args &&... args)
template <FixedString Fmt,typename... Args>
void
log_info(ObservationContext * ctx, Args &&... args)
template <FixedString Fmt,typename... Args>
void
log_error(ObservationContext * ctx, Args &&... args)
template <FixedString Fmt,typename... Args>
void
log_debug(ObservationContext * ctx, Args &&... args)
CategoryMasklogLevelToCategory(LogLevel level)
template <size_t N>
FixedString(const char(&)[N])

Attributes

Name
ObservationChannellog_level_channel_v
size_tMAX_FORMAT_ARGS
FormatIdINVALID_FORMAT_ID

Types Documentation

enum OutputFormat

EnumeratorValueDescription
Text
Both
Binary

How an event channel writes its output.

  • Text: Human-readable (events.log).
  • Binary: Compact binary (events.ctrace).
  • Both: Both sinks.

enum ObservationChannel

EnumeratorValueDescription
Warn3
Trace0
NumChannels5
Info2
Error4
Debug1

Identifies the observation channel for per-unit stats tracking.

enum ObservationChannel

EnumeratorValueDescription

Identifies the observation channel for per-unit stats tracking.

enum LogLevel

EnumeratorValueDescription
Warn2
Info1
Error3
Debug0

using FormatId

using chronon::observe::FormatId = uint32_t;

Compile-time format-string registration for zero-copy trace/log.

Format strings are registered at static-initialization time and assigned a unique 32-bit ID; the runtime transmits only ID + arg values, and the backend thread reconstructs formatted messages.

enum CounterId

EnumeratorValueDescription

Strongly typed counter identifier; indexes into the counter storage array.

enum CounterCsvFormat

EnumeratorValueDescription
Pivoted
Long

Counter CSV layout.

  • Long: One row per (cycle, unit, counter, value); streaming-friendly.
  • Pivoted: Rows are cycles, columns are counters; compact and readable.

using ComputeFn

using chronon::observe::ComputeFn = std::function<double(std::span<const uint64_t>)>;

Receives snapshotted delta values for each source counter (declaration order) and returns the derived value. Invoked on the backend thread at CSV dump time.

using CategoryMask

using chronon::observe::CategoryMask = uint64_t;

Bitmask for observability categories.

Bits 0-7 are reserved for built-in categories (counters, trace, log levels); bits 8-63 are user-defined unit-specific categories.

enum BackpressurePolicy

EnumeratorValueDescription
SpinWait
Drop
BoundedWait

Producer behavior when SPSC queues are full.

  • Drop: Drop immediately when queue full (zero stall, data loss).
  • SpinWait: Spin indefinitely until space available (zero data loss, may stall).
  • BoundedWait: Spin up to max_spins iterations, then drop (recommended default).

enum ArgType

EnumeratorValueDescription
UInt8
UInt64
UInt32
UInt16
String
Pointer
None0
Int8
Int64
Int32
Int16
Float
Double
Bool

Functions Documentation

function tracePipe

template <FixedString Fmt,
typename Cat ,
typename... Args>
inline void tracePipe(
ObservationContext * ,
Cat ,
const char * ,
Args && ...
)

function traceEvent

template <FixedString Fmt,
typename Cat ,
typename... Args>
inline void traceEvent(
ObservationContext * ,
Cat ,
Args && ...
)

function traceCounter

inline void traceCounter(
ObservationContext * ,
const char * ,
int64_t
)

function trace

template <FixedString Fmt,
typename Cat ,
typename... Args>
inline void trace(
ObservationContext * ctx,
Cat category,
Args &&... args
)

Emit a trace event with compile-time format string.

trace<"Cache HIT: addr=0x{:x}">(ctx, CACHE_HIT, addr);

function toIndex

uint32_t toIndex(
CounterId id
)

function makeCounterId

CounterId makeCounterId(
uint32_t value
)

function log_warn

template <FixedString Fmt,
typename... Args>
inline void log_warn(
ObservationContext * ctx,
Args &&... args
)

function log_info

template <FixedString Fmt,
typename... Args>
inline void log_info(
ObservationContext * ctx,
Args &&... args
)

function log_error

template <FixedString Fmt,
typename... Args>
inline void log_error(
ObservationContext * ctx,
Args &&... args
)

function log_debug

template <FixedString Fmt,
typename... Args>
inline void log_debug(
ObservationContext * ctx,
Args &&... args
)

function logLevelToCategory

CategoryMask logLevelToCategory(
LogLevel level
)

function FixedString

template <size_t N>
FixedString(
const char(&)[N]
)

Attributes Documentation

variable log_level_channel_v

ObservationChannel log_level_channel_v = LogLevelToChannel<L>::value;

variable MAX_FORMAT_ARGS

size_t MAX_FORMAT_ARGS = 8;

variable INVALID_FORMAT_ID

FormatId INVALID_FORMAT_ID = 0;

Updated on 2026-05-26 at 05:42:32 +0000