Skip to main content

error_budget_minutes

Function error_budget_minutes 

Source
pub fn error_budget_minutes(slo_percent: f64, period_days: f64) -> f64
Expand description

The allowed downtime, in minutes, implied by an availability SLO over a given period.

(100.0 − slo_percent) / 100.0 × period_days × 24.0 × 60.0.

§Arguments

  • slo_percent — the availability target, e.g. 99.9 for 99.9%.
  • period_days — the length of the budget period, in days.

§Returns

The allowed downtime for the period, in minutes.

§Examples

use software_engineering::error_budget::error_budget_minutes;

// A 99.9% target over 30 days permits roughly 43 minutes of downtime.
let budget = error_budget_minutes(99.9, 30.0);
assert!((budget - 43.2).abs() < 1e-9);