Skip to main content

Module size

Module size 

Source
Expand description

Memory and CPU value parsers shared by the engine and tests. Memory and CPU value parsers shared by the engine and tests.

Functionsยง

parse_cpus
Parse a CPU count string like "0.5", "1", "2.5" into nano-CPUs (1 CPU = 1_000_000_000 nano-CPUs).
parse_duration_nanos
Parse a duration like 5s, 200ms, 1m, 1h into nanoseconds (used by Docker healthcheck APIs).
parse_duration_secs
Parse a duration like 5s, 200ms, 1m, 1h into seconds (rounded down).
parse_memory
Parse a memory string like 128m, 1G, 1024k, 512b, or a bare number-of-bytes.