statpick

Crates.iostatpick
lib.rsstatpick
version0.1.2
created_at2025-12-16 20:25:04.613735+00
updated_at2026-01-09 19:25:20.561501+00
descriptionPick one system stat and report on it at the CLI, for scripts
homepage
repositoryhttps://github.com/erikh/statpick
max_upload_size
id1988618
size19,190
Erik Hollensbe (erikh)

documentation

README

statpick: command line tool to get one system stat, and only one

This program is designed to emit exactly one stat, and give you a few options for changing how that stat is calculated. It is meant to be used where parsing stats from another tool is 99% of the problem you are actually working on, such as in shell scripts, desktop integrations, etc.

The CPU functionality is still Linux-focused (and turned off on other platforms; patches welcome!), but the rest is intended to be provided in a cross platform way.

Usage

statpick installs the sp tool, which you can use in your scripts.

# basic cpu usage
$ sp cpu
44.2%
# default is supposed to be fast, but you can wait a little longer for a more
# reliable average over time. Time is fractional seconds.
$ sp cpu -w 0.5
12.5%
# memory stats default to free by default.
$ sp mem
79.7 GB
# just get the number...
$ sp mem -f
79693881344
# or use a different unit...
$ sp mem -u kb
79712272.0 kB
# maybe swap values are important? see also --include-swap
$ sp mem -m swap
536.6 MB
# these options all apply to free, used, and total values
$ sp mem used
48.7 GB

Next

More stats; I want better cross-platform integration, but I only really use Linux, so someone will have to send me patches.

Author

Erik Hollensbe git@hollensbe.org

License

MIT

Commit count: 5

cargo fmt