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
ErrorBudgetReliabilityReport.scala
Replay: real traced execution (multi-file project)
object Main {
  def main(args: Array[String]): Unit = {
    val spent = 2
    val budget = 5
    var status = "ok"

    if (spent >= budget - 1) {
      status = "watch"
    }
    if (spent > budget) {
      status = "halt"
    }

    println("spent=" + spent)
    println("budget=" + budget)
    println("status=" + status)
  }
}
object Main {
  def main(args: Array[String]): Unit = {
    val spent = 4
    val budget = 5
    var status = "ok"

    if (spent >= budget - 1) {
      status = "watch"
    }
    if (spent > budget) {
      status = "halt"
    }

    println("spent=" + spent)
    println("budget=" + budget)
    println("status=" + status)
  }
}
object Main {
  def main(args: Array[String]): Unit = {
    val spent = 7
    val budget = 5
    var status = "ok"

    if (spent >= budget - 1) {
      status = "watch"
    }
    if (spent > budget) {
      status = "halt"
    }

    println("spent=" + spent)
    println("budget=" + budget)
    println("status=" + status)
  }
}
  1. spent ← 2, budget ← 5, status ← ok

    1object Main {2  def main(args: Array[String]): Unit = {3    val spent→ 2 = 2 //@spent=4, 74    val budget→ 5 = 55    var status→ ok = "ok"67    if (spent >= budget - 1) {8      status = "watch"9    }10    if (spent > budget) {11      status = "halt"12    }1314    println("spent=" + spent2)15    println("budget=" + budget5)16    println("status=" + statusok)17  }18}
    outputspent=2
    budget=5
    status=ok
  1. spent ← 4, budget ← 5, status ← ok

    1object Main {2  def main(args: Array[String]): Unit = {3    val spent→ 4 = 44    val budget→ 5 = 55    var status→ ok = "ok"67    if (spent >= budget - 1) {
  2. status ← watch

    7if (spent4 >= budget5 - 1) {8  status→ watch = "watch"9}10if (spent > budget) {
  3. println("spent=" + spent)

    14    println("spent=" + spent4)15    println("budget=" + budget5)16    println("status=" + statuswatch)17  }18}
    outputspent=4
    budget=5
    status=watch
  1. spent ← 7, budget ← 5, status ← ok

    1object Main {2  def main(args: Array[String]): Unit = {3    val spent→ 7 = 74    val budget→ 5 = 55    var status→ ok = "ok"67    if (spent >= budget - 1) {
  2. status ← watch

    7if (spent7 >= budget5 - 1) {8  status→ watch = "watch"9}10if (spent > budget) {
  3. status ← halt

    9}10if (spent7 > budget5) {11  status→ halt = "halt"12}
  4. println("spent=" + spent)

    14    println("spent=" + spent7)15    println("budget=" + budget5)16    println("status=" + statushalt)17  }18}
    outputspent=7
    budget=5
    status=halt