Add Mac mini power monitoring - #11
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8aa0983fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bucketDuration: bucketDuration), | ||
| recordingSince: recordingSince, | ||
| bucketDuration: bucketDuration, | ||
| appTotals: try store.systemAppEnergyTotals(since: start, until: now)) |
There was a problem hiding this comment.
Include the first partial hour in All totals
When recording starts partway through an hour, recordingSince is the first minute-level power timestamp, while the corresponding app-energy bucket is keyed to the start of that hour. Passing start directly to systemAppEnergyTotals therefore excludes that entire first bucket via bucket_start >= since, so the All app ranking permanently omits up to an hour of energy and disagrees with app detail, which starts from the earliest app bucket. Align the app query start to the hour boundary or derive it from the earliest app-energy date.
Useful? React with 👍 / 👎.
| LineMark( | ||
| x: .value("Time", bucket.start), | ||
| y: .value("Average watts", bucket.averageWatts)) |
There was a problem hiding this comment.
Break the Stats chart across monitoring gaps
When Juice is stopped long enough to leave empty buckets, SystemPowerAnalytics.buckets omits those buckets, but this LineMark places every remaining point in one series. The Mac mini Stats chart consequently draws a continuous line across unmonitored periods and visually invents coverage; the popover avoids this by assigning a new series segment after a bucket gap. Apply equivalent segmentation here so outages remain visible.
Useful? React with 👍 / 👎.
Summary
Why
Mac minis have no battery, so the battery-oriented path could not provide a useful current-power view. Server mode reports current metered CPU, GPU, and Neural Engine draw while accumulating gap-aware local history without sampling away short workloads.
Verification
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make test— 244 tests across 33 suites passed with Xcode 26.6ARCHS=arm64 make app-adhoc— app and embedded helper built, signed, and verifiedgit diff --check— passed