feat: add simslim top — live fleet monitor with per-daemon drill-down - #17
Merged
Conversation
A top(1) for the simulator fleet: every booted simulator with its OS, slim state, process count, CPU, RAM, and disk, refreshing live. Enter a row (or pass a UDID) to drill into that simulator's per-daemon footprint. Columns sort via n/o/s/p/c/m/d with a version-aware OS comparator; the name column flexes to the terminal width. --json and piped output emit one-shot snapshots, keeping the JSON contract for the GUI. Library side stays dependency-free: MeasureProcesses keeps per-process footprint+cpu from the shared ps/top snapshot, and FleetSnapshot composes booted devices, slim status (fanned out per device), and MeasureMany. The TUI (bubbletea + lipgloss, CLI-only deps) anchors the cursor by UDID across live re-sorts, keeps the last snapshot on transient refresh errors, and guards disk sweeps against overlap. Also adds `simslim list --booted` to filter the listing to booted simulators.
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
simslim top— atop(1)for the simulator fleet, plussimslim list --booted.Fleet view (live, 2s refresh):
simslim top <udid>) → that simulator's per-daemon RAM/CPU breakdown, scrollable.n·o·s·p·c·m·d, press again to flip); OS uses a version-aware comparator so 9.0 < 26.4.--json/ piped output: one-shot snapshots (fleet or per-daemon) — same JSON-contract style the GUI decodes.How
MeasureProcesseskeeps the per-process footprint+cpu thatmeasureTreeused to discard (one sharedps/topsnapshot);fleet.go'sFleetSnapshotcomposes booted devices + slim status +MeasureMany, fanning the per-device status reads out in parallel so first paint waits on the slowest device, not the sum.cmd/simslim/top.go): bubbletea + lipgloss join urfave/cli as the CLI's deps; importers of the library inherit none of it.du) sweeps are TTL'd (30s) and guarded against overlap;/dev/null-style non-TTYs correctly fall back to static output via go-isatty.Also:
simslim list --bootedfilters the listing (text and--json) to booted simulators.Testing
make checkgreen; smoke-tested live against 7 booted simulators (mixed stock/slim, iOS 17.5–27.0).