Compare spent error budget with the allowed budget.

error-budget-report An error-budget report keeps the threshold and outcome label in the same trace.

Error Budget Reliability Report

spent
error_budget_reliability_report.rb
Replay: real traced execution (multi-file project)
spent = 2
budget = 5
status = "ok"

if spent >= budget - 1
  status = "watch"
end

if spent > budget
  status = "halt"
end

puts "spent=#{spent}"
puts "budget=#{budget}"
puts "status=#{status}"
spent = 4
budget = 5
status = "ok"

if spent >= budget - 1
  status = "watch"
end

if spent > budget
  status = "halt"
end

puts "spent=#{spent}"
puts "budget=#{budget}"
puts "status=#{status}"
spent = 7
budget = 5
status = "ok"

if spent >= budget - 1
  status = "watch"
end

if spent > budget
  status = "halt"
end

puts "spent=#{spent}"
puts "budget=#{budget}"
puts "status=#{status}"
  1. spent ← 2, budget ← 5, status ← ok

    1spent→ 2 = 2 #@spent=4, 72budget→ 5 = 53status→ ok = "ok"45if spent >= budget - 16  status = "watch"7end89if spent > budget10  status = "halt"11end1213puts "spent=#{spent2}"14puts "budget=#{budget5}"15puts "status=#{statusok}"
    outputspent=2
    budget=5
    status=ok
  1. spent ← 4, budget ← 5, status ← ok

    1spent→ 4 = 42budget→ 5 = 53status→ ok = "ok"
  2. status ← watch

    5if spent4 >= budget5 - 16  status→ watch = "watch"7end
  3. puts "spent=#{spent}"

    13puts "spent=#{spent4}"14puts "budget=#{budget5}"15puts "status=#{statuswatch}"
    outputspent=4
    budget=5
    status=watch
  1. spent ← 7, budget ← 5, status ← ok

    1spent→ 7 = 72budget→ 5 = 53status→ ok = "ok"
  2. status ← watch

    5if spent7 >= budget5 - 16  status→ watch = "watch"7end
  3. status ← halt

    9if spent7 > budget510  status→ halt = "halt"11end
  4. puts "spent=#{spent}"

    13puts "spent=#{spent7}"14puts "budget=#{budget5}"15puts "status=#{statushalt}"
    outputspent=7
    budget=5
    status=halt