Skip to main content

Module resources

Module resources 

Source
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/kit/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.