Skip to main content

Module metrics

Module metrics 

Source
Expand description

Global runtime metrics shared with frontends such as the CLI --tui mode. Global runtime metrics shared with frontends such as the CLI --tui mode.

The plugin runner stamps per-thread activity as data flows through its handlers and records a structured snapshot of every stats pulse; a frontend polls these from its render loop instead of scraping log lines.

Structs§

PulseSnapshot
Structured copy of the numbers a stats pulse logs, for frontends to render.

Functions§

db_retry_count
Total ClickHouse write retries this run.
init
Prepares metrics for a new run with thread_count firehose threads.
latest_pulse
Returns the most recent stats pulse, if any.
note_db_retry
Records one retried ClickHouse write attempt.
note_thread_activity
Records that data flowed through thread_id just now.
note_thread_transaction
Records one processed transaction on thread_id (also stamps activity).
now_ms
Milliseconds since metrics tracking began (a process-wide monotonic clock).
record_pulse
Stores the latest stats pulse.
resume_command_template
The resume command template recorded at CLI parse time, if any.
run_slot_range
The half-open slot range [start, end) of the current run, if one is active.
set_resume_command_template
Stores the process invocation with the range positional replaced by {range}, used to print an accurate resume command in fatal error messages. Set once at CLI parse time and deliberately not cleared by init (it describes the process, not the run).
set_run_slot_range
Records the half-open slot range [start, end) the current run covers.
thread_count
Number of firehose threads in the current run.
thread_idle_ms
Milliseconds since data last flowed through thread_id, or None if the thread has not reported any data yet.
thread_tx_count
Total transactions processed by thread_id so far.