Skip to main content

classify_resource_pressure

Function
This function is defined in the protocols module.
Classify coarse memory + disk pressure for the health surface (pure). A tiny, redaction-safe classifier that folds the wrapper’s /proc/cgroup memory-budget fraction and free-disk sample into a closed ok / elevated / critical / unknown vocabulary. Lives in core so the SDK and the bot classify identically; the wrapper owns the sampling. unknown is returned when a signal is missing and — per the issue — must never be treated as healthy by callers (it is deliberately not ok).

Signature

Returns

Dict[str, str]
<level>, “disk”: <level>}“ with values drawn from the closed vocabulary above.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 5046