Expand description
CPU and memory quantity parsing and formatting. CPU and memory quantity parsing and formatting.
Mirrors gokit’s workload resource helpers.
Memory parsing is delegated to the canonical rskit_util::bytes parser (binary suffixes k/ki … t/ti);
CPU is expressed in cores or millicores and normalized to nanocores.
Formatting produces the compact single-letter representation the workload vocabulary uses (512m, 2g).
Functions§
- format_
cpu - Format a nanocore count as a human-readable CPU string.
- format_
memory - Format a byte count as a human-readable memory string using binary suffixes.
- parse_
cpu - Parse a human-readable CPU string into nanocores.
- parse_
memory - Parse a human-readable memory string into bytes.