Derive hour observations, day aggregates, and monitoring periods #22
Notifications
Due Date
No due date set.
Blocks
Depends on
#24 Migrate the legacy observation history
xavierk/Fenris
Reference: xavierk/Fenris#22
Reference in New Issue
Block a user
Parent
Implement the Fenris persistent TUI monitoring redesign
Canonical contracts: fenris-redesign spec · acceptance criteria — criterion IDs cited below live in the register.
What to build
Repeated collection runs across a fixture timeline accumulate real habit history in the observation store. Each hour classifies by the named constants — powered-off when the hour's power-on-hours delta is below 90 % of its wall-clock span, active at ≥ 256 MiB written, idle when powered on and sampled below that, unknown otherwise — with the four splits summing to exactly 3600 s. UTC-bounded day aggregates derive monotonically from hour rows (no 23- or 25-hour days ever exist). Coverage — the known share of wall-clock seconds inside monitoring periods — is computed and carried on the rows. Raw samples prune opportunistically to 14 days. Monitoring periods behave: a collection run finding no open period opens one at the run moment, never backdated; wall-clock outside periods is excluded from numerator and denominator; unexplained gaps inside a period keep the aggregate counter delta, remain unknown seconds, and reduce coverage. No absent hour is ever interpolated, estimated, or fabricated.
Acceptance criteria
Blocked by