pub struct SpoolStats {
pub unspooled_entries: u32,
pub unspooled_samples: u32,
pub watermark: LogPosition,
pub head: LogPosition,
pub dropped_unspooled: u32,
pub data_lost: bool,
}Expand description
Replication accounting for a log.
Returned by SensorDb::spool_stats. Kept separate from DbStats, which
describes the sector index and means the same thing whether or not anything
is replicating this log.
Fields§
§unspooled_entries: u32Durable entries not yet known to be replicated elsewhere.
Entries, which is the unit a spool pass moves and its
budget is denominated in. For “how many readings
are still only here”, see
unspooled_samples.
unspooled_samples: u32Durable samples not yet known to be replicated elsewhere.
Larger than unspooled_entries when the
un-replicated tail holds runs.
watermark: LogPositionEverything strictly before this position is durably replicated.
head: LogPositionPosition after the newest entry.
dropped_unspooled: u32Entries the ring overwrote before they could be replicated.
Counted against the watermark as it stood at the time of the eviction.
Because mount starts every run with the watermark at
LogPosition::BEGINNING, data overwritten before a replica reappears
and calls restore_spool_watermark
is counted here even if a replica already had it. Attach early in boot,
or seed the watermark from wherever the application stashed it.
data_lost: boolSticky: set once any un-replicated data has been overwritten, never cleared. Surface this to the operator — it means data may have been lost.
On a log that never replicates, everything is un-replicated, so this
becomes true the first time the ring wraps. That is accurate but rarely
interesting: SpoolStats is only meaningful for a log with a replica.
Trait Implementations§
Source§impl Clone for SpoolStats
impl Clone for SpoolStats
impl Copy for SpoolStats
Source§impl Debug for SpoolStats
impl Debug for SpoolStats
Source§impl Default for SpoolStats
impl Default for SpoolStats
impl Eq for SpoolStats
Source§impl Format for SpoolStatswhere
LogPosition: Format,
Available on crate feature defmt only.
impl Format for SpoolStatswhere
LogPosition: Format,
defmt only.