store
store
¶
SQLite-backed telemetry storage.
Classes¶
TelemetryStore
¶
Append-only SQLite store for inference telemetry records.
Writes are batched in memory and flushed to SQLite when a batch reaches
batch_size, when flush_interval_seconds elapses (a background
flusher thread guarantees this even with no further writes), on any read
through this store, and on close(). Readers that open their OWN
connection to the database file (e.g. TelemetryAggregator) therefore
see new rows within flush_interval_seconds at the latest; call
flush() first for immediate visibility. Pass
flush_interval_seconds=0 to disable time-based flushing (batch-size
and read/close flushes still apply).
Source code in src/openjarvis/telemetry/store.py
Functions¶
record
¶
record(rec: TelemetryRecord) -> None
Persist a single telemetry record.
Source code in src/openjarvis/telemetry/store.py
record_mining_stats
¶
Persist one mining stats snapshot.
stats is duck-typed to keep telemetry usable without importing the
optional mining package at module import time.
Source code in src/openjarvis/telemetry/store.py
flush
¶
list_recent
¶
Return recent telemetry rows as dictionaries.
Source code in src/openjarvis/telemetry/store.py
list_recent_mining_stats
¶
Return recent mining stats snapshots as dictionaries.
Source code in src/openjarvis/telemetry/store.py
close
¶
Flush pending records and close the underlying SQLite connection.