Repository navigation
feat(ui): refresh machine stats every minute (OH-59) - #34
Merged
Merged
Conversation
Machine monitoring now reads each visible host every 60 seconds instead of every 180. The shared MACHINE_METRICS_REFRESH_MS owner drives the poll interval, the stale marker and the saved-reading freshness, so all three move together. The sidebar copy says "every minute" in all 12 locales. The browser spec now asserts the real cadence from request timestamps (55-75 s between reads, no extra reads from navigation or collapsing) instead of exact counts, which a one-minute cadence makes timing-dependent.
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.
What changes
Machine stats in the sidebar now refresh every minute instead of every 3 minutes, as requested.
MACHINE_METRICS_REFRESH_MSin@happier-dev/protocolgoes from 180 000 to 60 000 ms. That one constant drives the poll interval, the row's "Previous reading · stale" threshold and the saved-reading freshness, so all three change together.Validation
RED → GREEN: the store test (
machineMetricsStore.test.ts) and the hook test (useMachineMetrics.test.ts) now pin a 60-second cadence. Both failed on the 180-second constant with no read at 60 s, then passed. Machine-metrics owner and locale tests: 38 passed.Chrome,
machines.monitoring.oh59.spec.ts(whole file): 4/4 pass in 5.2 min, down from about 6 at the old interval. The cadence test now asserts from request timestamps instead of exact counts, because a one-minute cadence makes counts depend on timing:Measured gaps between requests to the real host: 59.1 s, plus 120.1 s across the deliberate disconnect.
Typechecks pass for UI, tests and protocol.
Hosted CI run 42636162230: attempt 1 failed only in
newSession.resumeId.browseFill.spec.ts, a/newnavigation timeout in a spec that doesn't touch machine metrics. The same spec flaked the same way on PR fix(ui): tell users how to get host metrics on unsupported machines (OH-59) #17 and passed on PR feat(ui): read host metrics from released CLIs through the machine shell (OH-59) #33 and ondev. The failed jobs were rerun once, and attempt 2 passed.Not run: full suites (CI owns them) and native app QA.
Scope and deferrals
topon macOS, or a PowerShell start and about 45 KB of GPU counters on Windows. That happens only while the sidebar section is visible.Tracks OH-59.