Store time in zone instead of computing it #159
Labels
No labels
accessibility
area:accounts
area:ai-evals
area:look
area:maps
area:platform
area:rides-progress
area:riding
area:today-plan-coach
area:ui-shell
bot:blocked
bot:failed
bot:pr
bot:waiting
bot:working
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
later
now
owner-check
parked
question
ready
session
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/trainer#159
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
(session 15) Time in zone is computed, not stored: each Progress load decodes every ride stream in the range. Fine for one athlete (13 rides with power in 3 months); for a year of power rides, or when the polarised-split rule needs it, store zone seconds on
Rideat import and when thresholds change.Moved from docs/PROGRESS.md → Follow-ups → Later on 2026-11-08.
What this is about. Progress → Time in zone is worked out on each page load by decoding every ride stream in the range. Fine for a few months of rides; slow for a year of power rides.
Status (checked 2026-11-08): unchanged; zone seconds aren't stored.
Fix: store zone seconds on each ride at import, and recompute when thresholds change (the rescore already visits those rides). Session 53 (#228) grades the easy-share rule over planned zones, so it doesn't need this. #102 (Today's zones) would use the same stored numbers.
Status (checked 2026-11-18): half done. #102 added
Ride.powerHistogram(one additive migration), and Today's time in zone reads it. Progress still decodes every ride stream in the range for its time-in-zone chart (src/server/progress-store.ts:163).What's left: Progress reads the stored power histogram instead of decoding streams. Heart-rate zones have no stored equivalent, so they still need the streams (or an
hrHistogramalongside).