Parsers of the Linux /proc files the load sampler reads: stat, pressure, meminfo, loadavg, key-value files
$ sexc add @ajax/mesh-load-proc- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 05:24v/# 1 version
- drwxr-xr-x-Oct 27 05:24files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 05:24 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-abi-host-load ^0.1.0, @ajax/mesh-buf ^0.1.0, @ajax/mesh-rsfmt ^0.1.0, @ajax/mesh-check ^0.1.0
- dependents
- @ajax/mesh-load-host
- keywords
- mesh alphaos load proc cpu psi memory
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-load-proc
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-load-proc 2 3Parsers of the Linux /proc files the load sampler reads: stat, pressure, meminfo, loadavg, key-value files. 4 5The pure parsers of load.rs: /proc/stat's CPU times, the big/little core classes, PSI (the /proc/pressure files), /proc/meminfo, /proc/loadavg and `key value` / `Key: value` files. Errors are the Rust's text. The OS readers that feed them are mesh-load-host. 6 7```c 8#include "mesh/load_proc.h" 9``` 10 11## Ported from 12 13[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/load.rs: `CpuTimes` (since), `parse_proc_stat`, `classify`, `class_util`, `Psi`, `parse_psi`, `psi_rate`, `MemInfo`, `parse_meminfo`, `parse_loadavg`, `field`. 14 15## Tests 16 17- `tests/load_proc.c`: load.rs's `proc_stat`, `cpu_rates`, `classes`, `psi_and_meminfo`, with the error texts. 18 19## Differences 20 21- Per-CPU results are fixed arrays of `MESH_MAX_CPUS` with a presence flag, where the Rust has `Vec<Option<_>>`. 22 23## Licence 24 25MIT. See the repository's LICENSE.