Add burn rate calculation helper

This commit is contained in:
Oliver Neumann 2025-07-28 17:45:00 +00:00
parent 009158ee4d
commit d3b59c2bce

View file

@ -62,3 +62,11 @@ def main():
if __name__ == "__main__":
main()
def burn_rate(error_rate: float, window_hours: float, target: float) -> float:
"""Calculate burn rate: how fast the error budget is being consumed."""
budget = 1.0 - target
if budget == 0:
return float("inf")
return error_rate / budget * (window_hours / (30 * 24))