Add burn rate calculation helper
This commit is contained in:
parent
009158ee4d
commit
d3b59c2bce
1 changed files with 8 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue