| Crates.io | statpick |
| lib.rs | statpick |
| version | 0.1.2 |
| created_at | 2025-12-16 20:25:04.613735+00 |
| updated_at | 2026-01-09 19:25:20.561501+00 |
| description | Pick one system stat and report on it at the CLI, for scripts |
| homepage | |
| repository | https://github.com/erikh/statpick |
| max_upload_size | |
| id | 1988618 |
| size | 19,190 |
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.
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
More stats; I want better cross-platform integration, but I only really use Linux, so someone will have to send me patches.
Erik Hollensbe git@hollensbe.org
MIT