mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Sleep is stored one row per stage, and the timeline read it like any other type: the live path took the mean of a day's rows and the long path the rolled-up month of them, so IN_BED, AWAKE and every CORE fragment counted as a night, and a quarter of seven-hour nights read as under two hours. The sleep series now reconstructs nights the way the sleep page and the day view do (CORE + DEEP + REM of the night's winning writer, keyed by its wake day) and averages the bucket's nights, on every window length; the rollups are not read for it. The stage rows are read a year at a time with a day's margin on either side, so no read holds a decade of rows and no night is cut where one read ends. A long window is cached per record like the other long series.