feat: add vmstat builtin for host memory/CPU/IO pressure investigation#557
Draft
Hitsuji-M wants to merge 4 commits into
Draft
feat: add vmstat builtin for host memory/CPU/IO pressure investigation#557Hitsuji-M wants to merge 4 commits into
Hitsuji-M wants to merge 4 commits into
Conversation
Hitsuji-M
force-pushed
the
erwann.masson/builtin-vmstat
branch
from
July 17, 2026 12:28
2a09b7e to
49bbf62
Compare
matt-dz
reviewed
Jul 21, 2026
matt-dz
left a comment
Collaborator
There was a problem hiding this comment.
looks good for the most part. however, i recommend running a review loop with codex -- it catches more in-the-weeds issues with the builtin logic
| // readImpl returns ErrNotSupported on platforms without a backend | ||
| // (Windows and anything else). Mirrors diskstats_other.go. | ||
| func readImpl(_ context.Context, _ string) (Stats, error) { | ||
| return Stats{}, ErrNotSupported |
Collaborator
There was a problem hiding this comment.
what's the reason for not supporting windows? asking because i'm unfamiliar with the platform and want to understand the decision
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
vmstatbuiltin for host memory/CPU/IO pressure investigation, mirroring the existingdf/ssarchitecture./proc/{stat,meminfo,vmstat,loadavg,uptime}directly (sandbox-exempt, same pattern asss/ip route/df).sysctl(3)(hw.memsize,vm.swapusage,vm.loadavg) using the existing darwin toolset, not Machhost_statistics64; unavailable columns render as0/-rather than being fabricated.vmstat DELAY [COUNT]sampling, and-s/--statsfull counter summary, plus-a,-w,-S k|K|m|M,-h/--help.analysis/symbols_builtins.goandanalysis/symbols_internal.goallowlists,SHELL_FEATURES.md,README.md, andAGENTS.mdsecurity design decisions.Test plan
make fmt/gofmt -l .cleango test ./analysis/... ./builtins/... ./tests/.../procfixtures (builtins/tests/vmstat/vmstat_linux_test.go, run via Dockergolang:1.25)tests/scenarios/cmd/vmstat/(allskip_assert_against_bash: true— vmstat isn't indebian:bookworm-slimand output is host-state-dependent)-a,-w,-s,--help