Skip to main content

Crate gpuviewer_history

Crate gpuviewer_history 

Source
Expand description

gpuviewer-history — the flight recorder’s storage.

Two layers:

  • RAM ring buffers (DeviceHistory/HistoryStore) for the live window + an event log.
  • SQLite (store) for the persistent, replayable tail: 10s/1m downsampled rollups + an append-only event log, with retention pruning. The Recorder is the bridge — it folds the raw 1 Hz stream into bucket aggregates and flushes completed buckets to the store. Raw 1 Hz samples NEVER reach SQLite (CLAUDE.md decision; netdata’s dbengine lesson): only the per-bucket min/avg/max do.

Re-exports§

pub use store::DataSource;
pub use store::DeviceRow;
pub use store::ExportCounts;
pub use store::ProcessRollup;
pub use store::SampleRollup;
pub use store::SqliteStore;
pub use store::StoreError;
pub use store::Tier;
pub use store::RETAIN_10S_MS;
pub use store::RETAIN_1M_MS;
pub use store::RETAIN_EVENTS_MS;
pub use store::SCHEMA_VERSION;

Modules§

store
The SQLite tier of the flight recorder — the wedge feature: persistent, replayable history. RAM rings (see lib.rs) cover the live window; this layer keeps the long tail so a user can scroll back to “02:14 last Tuesday” and see why a run stalled.

Structs§

DeviceHistory
Fixed-capacity ring of samples for one device’s live window.
HistoryStore
All devices’ rings + the event log.
Recorder
Folds the live 1 Hz stream into persistent rollups. Feed it every frame via Recorder::observe; it accumulates into both tiers’ current buckets and, when a frame’s timestamp crosses a bucket boundary, flushes the just-completed bucket’s rows to the SqliteStore. Call Recorder::flush on shutdown to persist the partial tail.

Enums§

WriteTransition
An edge in the recorder’s ability to persist, drained by the collector and narrated as a fact. Only EDGES are reported: a full disk fails on every single write, and a per-write event would bury the story it is trying to tell.