Skip to main content

evaluate_pressure

Function
This function is defined in the protocols module.
Pure, deterministic classification of gateway load. No I/O. Reads back facts the enforcement layer already computes (AdmissionGate.stats(), the outbox status counts, the watchdog’s measured lag) and folds them into a single :class:HealthPressure. Lives in core — like :func:compute_config_revision — so the SDK and the bot classify identically without divergence. Classification (highest wins):
  • "saturated" — admission is full and work is queuing, the outbound dead-letter tier is non-empty, or the event loop is lagging badly (>= 500 ms): shed / stall is imminent or occurring.
  • "elevated" — admission is highly utilised (>= 80 %), the inbound or outbound backlog is building, or the loop is lagging (>= 100 ms).
  • "nominal" — none of the above.

Signature

Returns

HealthPressure
class:HealthPressure ready for the health surface.

Uses

  • HealthPressure

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 1269

Evaluation Concept

LLM as Judge

Evaluation Loop