chronon::observe::ClockTraceRecorder
#include <ClockTraceRecorder.hpp>
Public Classes
| Name | |
|---|---|
| struct | Stats |
| struct | Config |
Public Functions
| Name | |
|---|---|
| ~ClockTraceRecorder() | |
| bool | tryAdmitClockBatch(const SimTime & time) Single scheduler coordinator only; false means retry after backend drain. |
| Stats | stats() const Valid after close(); includes metadata files and both enabled sinks. |
| void | startParallel(size_t lookahead_batches) |
| void | start(bool serial_coordinator =false) |
| void | publishClockProgress(uint64_t exclusive_ns) |
| bool | parallelActive() const |
| ClockTraceRecorder & | operator=(const ClockTraceRecorder & ) =delete |
| bool | needsProgress() const |
| void | endClockBatch() |
| bool | enabled() const |
| void | defineEvent(ClockEventKind kind, std::string name) |
| void | close() |
| void | beginClockBatch(const SimTime & time) |
| void | advance(uint64_t exclusive_ns) |
| ClockTraceStream * | addStream(const ClockDomain & domain, uint32_t unit_id, std::string unit_name) |
| ClockTraceStream * | addProducerStream(ClockTraceStream * unit, uint64_t producer_order) |
| ClockTraceRecorder(Config config) | |
| ClockTraceRecorder(const ClockTraceRecorder & ) =delete |
Friends
| Name | |
|---|---|
| class | ClockTraceStream |
Public Functions Documentation
function ~ClockTraceRecorder
~ClockTraceRecorder()
function tryAdmitClockBatch
bool tryAdmitClockBatch(
const SimTime & time
)
Single scheduler coordinator only; false means retry after backend drain.
function stats
Stats stats() const
Valid after close(); includes metadata files and both enabled sinks.
function startParallel
void startParallel(
size_t lookahead_batches
)
Scheduler-owned, nonblocking observation credits. Compact staging for admitted ns buckets lets the backend drain EVERY ingress stream without waiting for simulation progress, including several actors on one worker.
function start
void start(
bool serial_coordinator =false
)
Serial coordinator mode requires begin/endClockBatch around all producers. All records must belong to that exact batch time; do not advance/finish individual streams. Leave disabled for independent worker streams.
function publishClockProgress
void publishClockProgress(
uint64_t exclusive_ns
)
All records below this bound have been published (units AND CDC commits). Does not wait for the backend; quiet actors need no per-stream advance.
function parallelActive
bool parallelActive() const
function operator=
ClockTraceRecorder & operator=(
const ClockTraceRecorder &
) =delete
function needsProgress
bool needsProgress() const
function endClockBatch
void endClockBatch()
function enabled
bool enabled() const
function defineEvent
void defineEvent(
ClockEventKind kind,
std::string name
)
function close
void close()
Join/drain and finish the open tail buckets. Encoded prefixes are already available during recording; no whole-trace sorting or temporary disk IO. I/O errors are surfaced here and to blocked producers.
function beginClockBatch
void beginClockBatch(
const SimTime & time
)
function advance
void advance(
uint64_t exclusive_ns
)
Coordinator-only alternative to per-stream advance: ALL producers must have published every event with floor(time/ns) < exclusive_ns before this call, and promise never to publish another. Waits for backend acknowledgement. Use at scheduler safe points, not sequential blocking per-stream advances.
function addStream
ClockTraceStream * addStream(
const ClockDomain & domain,
uint32_t unit_id,
std::string unit_name
)
function addProducerStream
ClockTraceStream * addProducerStream(
ClockTraceStream * unit,
uint64_t producer_order
)
Independent actor, same logical unit/track. Stable nonzero producer_order breaks commit ties (CDC uses FIFO ID + 1), never a host worker identity.
function ClockTraceRecorder
explicit ClockTraceRecorder(
Config config
)
function ClockTraceRecorder
ClockTraceRecorder(
const ClockTraceRecorder &
) =delete
Friends
friend ClockTraceStream
friend class ClockTraceStream(
ClockTraceStream
);
Updated on 2026-09-20 at 14:23:39 +0000