Worst-case (highest) pressure level across every engine that has a configured budget. Cheap: iterates the in-memory budget map and allocates nothing — meant to be called once per Data-Plane core-loop tick, unlike [`snapshot`](Self::snapshot) which materialises a `Vec`. Returns `Normal` when no engine budgets are configured.
(&self)
| 436 | /// tick, unlike [`snapshot`](Self::snapshot) which materialises a `Vec`. |
| 437 | /// Returns `Normal` when no engine budgets are configured. |
| 438 | pub fn worst_engine_pressure(&self) -> PressureLevel { |
| 439 | self.budgets |
| 440 | .values() |
| 441 | .map(|b| self.thresholds.level_for(b.utilization_percent())) |
| 442 | .max() |
| 443 | .unwrap_or(PressureLevel::Normal) |
| 444 | } |
| 445 | |
| 446 | /// Set custom pressure thresholds. |
| 447 | pub fn set_thresholds(&mut self, thresholds: PressureThresholds) { |
no test coverage detected