feat(status): battery health scoring and uptime warning#663
Merged
Conversation
- Battery card now shows health label (Healthy/Fair/Service Soon) based on cycle count and capacity thresholds, with color-coded cycles - Uptime in header is color-coded: green ≤7d, yellow 7-14d, red >14d with restart indicator - Both metrics now factor into the overall health score - Added tests for batteryHealthLabel, uptimeSeverity, and health score battery/uptime penalties
Contributor
Author
Visual PreviewPower Card — Before vs AfterBefore (raw data only): After (health label + colored cycles): With aging battery (600 cycles, 87% capacity): With worn battery (950 cycles, 74% capacity): Header — Uptime WarningNormal (≤7 days): Warning (7–14 days, yellow): Danger (>14 days, red + restart indicator): Health Score Impact
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two health indicators to
mo statusthat surface actionable information already collected but not highlighted:These were discussed in #659 as features that fit naturally inside
mo statuswithout creating overlap.What changed
metrics.goUptimeSecondsfield toMetricsSnapshotmetrics_health.gobatteryHealthLabel()anduptimeSeverity()helpersmetrics_health_test.goview.goTest plan
go build ./cmd/status/— compiles cleanlygo vet ./cmd/status/— no issuesgo test ./cmd/status/— all 55 tests passuptime_secondsand battery data