MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / worst_engine_pressure

Method worst_engine_pressure

nodedb-mem/src/governor.rs:438–444  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 1

apply_spsc_pressureMethod · 0.80

Calls 2

level_forMethod · 0.80
utilization_percentMethod · 0.80

Tested by

no test coverage detected