Compare current resource usage with the planned baseline and label the drift.

drift report Resource drift reports turn fixed capacity readings into small labels that are easy to trace.

Resource Drift Report

current
ResourceDrift.kt
Replay: real traced execution (multi-file project)
fun main() {
    val current = 112
    val baseline = 100
    val drift = current - baseline
    var driftStatus = "normal"

    if (drift >= 25) {
        driftStatus = "high"
    } else if (drift >= 10) {
        driftStatus = "elevated"
    }

    println("current=$current drift=$drift status=$driftStatus")
}
fun main() {
    val current = 103
    val baseline = 100
    val drift = current - baseline
    var driftStatus = "normal"

    if (drift >= 25) {
        driftStatus = "high"
    } else if (drift >= 10) {
        driftStatus = "elevated"
    }

    println("current=$current drift=$drift status=$driftStatus")
}
fun main() {
    val current = 130
    val baseline = 100
    val drift = current - baseline
    var driftStatus = "normal"

    if (drift >= 25) {
        driftStatus = "high"
    } else if (drift >= 10) {
        driftStatus = "elevated"
    }

    println("current=$current drift=$drift status=$driftStatus")
}
  1. current ← 112, baseline ← 100, drift ← 12, driftStatus ← normal

    1fun main() {2    val current→ 112 = 112 //@current=103, 1303    val baseline→ 100 = 1004    val drift→ 12 = current112 - baseline1005    var driftStatus→ normal = "normal"
  2. driftStatus ← elevated

    8    driftStatus = "high"9} else if (drift12 >= 10) {10    driftStatus→ elevated = "elevated"11}
  3. println("current=$current drift=$drift status=$driftStatus")

    13    println("current=$current112 drift=$drift12 status=$driftStatuselevated")14}
    outputcurrent=112 drift=12 status=elevated
  1. current ← 103, baseline ← 100, drift ← 3, driftStatus ← normal

    1fun main() {2    val current→ 103 = 1033    val baseline→ 100 = 1004    val drift→ 3 = current103 - baseline1005    var driftStatus→ normal = "normal"67    if (drift >= 25) {8        driftStatus = "high"9    } else if (drift >= 10) {10        driftStatus = "elevated"11    }1213    println("current=$current103 drift=$drift3 status=$driftStatusnormal")14}
    outputcurrent=103 drift=3 status=normal
  1. current ← 130, baseline ← 100, drift ← 30, driftStatus ← normal

    1fun main() {2    val current→ 130 = 1303    val baseline→ 100 = 1004    val drift→ 30 = current130 - baseline1005    var driftStatus→ normal = "normal"
  2. driftStatus ← high

    7if (drift30 >= 25) {8    driftStatus→ high = "high"9} else if (drift >= 10) {
  3. println("current=$current drift=$drift status=$driftStatus")

    13    println("current=$current130 drift=$drift30 status=$driftStatushigh")14}
    outputcurrent=130 drift=30 status=high