chronon::observe
Namespaces
| Name |
|---|
| chronon::observe::simd |
| chronon::observe::category |
| chronon::observe::DerivedFormula Convenience formulas for common derived-counter patterns. |
Classes
| Name | |
|---|---|
| struct | chronon::observe::ArgTypeOf< uint8_t > |
| struct | chronon::observe::ArgTypeOf< uint64_t > |
| struct | chronon::observe::ArgTypeOf< uint32_t > |
| struct | chronon::observe::ArgTypeOf< uint16_t > |
| struct | chronon::observe::ArgTypeOf< int8_t > |
| struct | chronon::observe::ArgTypeOf< int64_t > |
| struct | chronon::observe::ArgTypeOf< int32_t > |
| struct | chronon::observe::ArgTypeOf< int16_t > |
| struct | chronon::observe::ArgTypeOf< float > |
| struct | chronon::observe::ArgTypeOf< double > |
| struct | chronon::observe::ArgTypeOf< const char * > |
| struct | chronon::observe::ArgTypeOf< char * > |
| struct | chronon::observe::ArgTypeOf< bool > |
| struct | chronon::observe::ArgTypeOf< T * > |
| struct | chronon::observe::ArgTypeOf Maps a C++ type to its ArgType. |
| struct | chronon::observe::ArenaSnapshot Copy of the arena region referenced by a batch of flushed records. |
Types
| Name | |
|---|---|
| enum class uint8_t | OutputFormat { Text, Both, Binary} How an event channel writes its output. |
| enum class uint8_t | ObservationChannel { Warn = 3, Trace = 0, NumChannels = 5, Info = 2, Error = 4, Debug = 1} Identifies the observation channel for per-unit stats tracking. |
| enum class uint8_t | ObservationChannel { } Identifies the observation channel for per-unit stats tracking. |
| enum class uint8_t | LogLevel { Warn = 2, Info = 1, Error = 3, Debug = 0} |
| using uint32_t | FormatId Compile-time format-string registration for zero-copy trace/log. |
| enum class uint32_t | CounterId { } Strongly typed counter identifier; indexes into the counter storage array. |
| enum class uint8_t | CounterCsvFormat { Pivoted, Long} Counter CSV layout. |
| using std::function< double(std::span< const uint64_t >)> | ComputeFn |
| using uint64_t | CategoryMask Bitmask for observability categories. |
| enum class uint8_t | BackpressurePolicy { SpinWait, Drop, BoundedWait} Producer behavior when SPSC queues are full. |
| enum class uint8_t | ArgType { 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 && ...) |
| void | traceCounter(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_t | toIndex(CounterId id) |
| CounterId | makeCounterId(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) |
| CategoryMask | logLevelToCategory(LogLevel level) |
| template <size_t N> | FixedString(const char(&)[N]) |
Attributes
| Name | |
|---|---|
| ObservationChannel | log_level_channel_v |
| size_t | MAX_FORMAT_ARGS |
| FormatId | INVALID_FORMAT_ID |
Types Documentation
enum OutputFormat
| Enumerator | Value | Description |
|---|---|---|
| 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
| Enumerator | Value | Description |
|---|---|---|
| Warn | 3 | |
| Trace | 0 | |
| NumChannels | 5 | |
| Info | 2 | |
| Error | 4 | |
| Debug | 1 |
Identifies the observation channel for per-unit stats tracking.
enum ObservationChannel
| Enumerator | Value | Description |
|---|
Identifies the observation channel for per-unit stats tracking.
enum LogLevel
| Enumerator | Value | Description |
|---|---|---|
| Warn | 2 | |
| Info | 1 | |
| Error | 3 | |
| Debug | 0 |
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
| Enumerator | Value | Description |
|---|
Strongly typed counter identifier; indexes into the counter storage array.
enum CounterCsvFormat
| Enumerator | Value | Description |
|---|---|---|
| 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
| Enumerator | Value | Description |
|---|---|---|
| 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
| Enumerator | Value | Description |
|---|---|---|
| UInt8 | ||
| UInt64 | ||
| UInt32 | ||
| UInt16 | ||
| String | ||
| Pointer | ||
| None | 0 | |
| 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