Operational Reliability Reports
Incident Queue Reliability Report
Count visible incidents from a fixed severity queue and selected threshold.
severity threshold
A queue report can stay deterministic by keeping severities in a local slice and deriving counts from a selected threshold.
Incident Queue Reliability Report
incident_queue_reliability_report.go
Replay: real traced execution (multi-file project)
package main
import "fmt"
func main() {
var minSeverity = 2
severities := []int{1, 2, 3, 3}
visible := 0
high := 0
for _, severity := range severities {
if severity >= minSeverity {
visible++
}
if severity >= 3 {
high++
}
}
fmt.Printf("min=%d visible=%d high=%d\n", minSeverity, visible, high)
}
package main
import "fmt"
func main() {
var minSeverity = 1
severities := []int{1, 2, 3, 3}
visible := 0
high := 0
for _, severity := range severities {
if severity >= minSeverity {
visible++
}
if severity >= 3 {
high++
}
}
fmt.Printf("min=%d visible=%d high=%d\n", minSeverity, visible, high)
}
package main
import "fmt"
func main() {
var minSeverity = 3
severities := []int{1, 2, 3, 3}
visible := 0
high := 0
for _, severity := range severities {
if severity >= minSeverity {
visible++
}
if severity >= 3 {
high++
}
}
fmt.Printf("min=%d visible=%d high=%d\n", minSeverity, visible, high)
}
minSeverity ← 2, severities ← []int{1, 2, 3, 3}, visible ← 0, high ← 0
5func main() {6 var minSeverity→ 2 = 2 //@minSeverity=1, 37 severities→ []int{1, 2, 3, 3} := []int{1, 2, 3, 3}8 visible→ 0 := 09 high→ 0 := 0for _, severity := range severities
pass 1 of 411for _, severity1 := range severities[]int{1, 2, 3, 3} {12 if severity >= minSeverity {All 4 passes — pass 1 is the card above pass severityhigh1 1 — 2 2 — 3 3 0 → 1 4 3 1 → 2 visible ← 1
pass 1 of 311for _, severity := range severities {12 if severity2 >= minSeverity2 {13 visible→ 1++14 }All 3 passes — pass 1 is the card above pass severityvisiblehigh1 2 0 → 1 — 2 3 1 → 2 0 → 1 3 3 2 → 3 1 → 2 high ← 1
pass 1 of 214}15if severity3 >= 3 {16 high→ 1++17}high ← 2
pass 2 of 214}15if severity3 >= 3 {16 high→ 2++17}fmt.Printf("min=%d visible=%d high=%d ", minSeverity, visible, high)
20 fmt.Printf("min=%d visible=%d high=%d\n", minSeverity2, visible3, high2)21}outputmin=2 visible=3 high=2
minSeverity ← 1, severities ← []int{1, 2, 3, 3}, visible ← 0, high ← 0
5func main() {6 var minSeverity→ 1 = 17 severities→ []int{1, 2, 3, 3} := []int{1, 2, 3, 3}8 visible→ 0 := 09 high→ 0 := 0for _, severity := range severities
pass 1 of 411for _, severity1 := range severities[]int{1, 2, 3, 3} {12 if severity >= minSeverity {All 4 passes — pass 1 is the card above pass severityhigh1 1 — 2 2 — 3 3 0 → 1 4 3 1 → 2 visible ← 1
pass 1 of 411for _, severity := range severities {12 if severity1 >= minSeverity1 {13 visible→ 1++14 }All 4 passes — pass 1 is the card above pass severityvisiblehigh1 1 0 → 1 — 2 2 1 → 2 — 3 3 2 → 3 0 → 1 4 3 3 → 4 1 → 2 high ← 1
pass 1 of 214}15if severity3 >= 3 {16 high→ 1++17}high ← 2
pass 2 of 214}15if severity3 >= 3 {16 high→ 2++17}fmt.Printf("min=%d visible=%d high=%d ", minSeverity, visible, high)
20 fmt.Printf("min=%d visible=%d high=%d\n", minSeverity1, visible4, high2)21}outputmin=1 visible=4 high=2
minSeverity ← 3, severities ← []int{1, 2, 3, 3}, visible ← 0, high ← 0
5func main() {6 var minSeverity→ 3 = 37 severities→ []int{1, 2, 3, 3} := []int{1, 2, 3, 3}8 visible→ 0 := 09 high→ 0 := 0for _, severity := range severities
pass 1 of 411for _, severity1 := range severities[]int{1, 2, 3, 3} {12 if severity >= minSeverity {All 4 passes — pass 1 is the card above pass severityminSeverityvisiblehigh1 1 — — — 2 2 — — — 3 3 3 0 → 1 0 → 1 4 3 3 1 → 2 1 → 2 visible ← 1
pass 1 of 211for _, severity := range severities {12 if severity3 >= minSeverity3 {13 visible→ 1++14 }high ← 1
pass 1 of 214}15if severity3 >= 3 {16 high→ 1++17}visible ← 2
pass 2 of 211for _, severity := range severities {12 if severity3 >= minSeverity3 {13 visible→ 2++14 }high ← 2
pass 2 of 214}15if severity3 >= 3 {16 high→ 2++17}fmt.Printf("min=%d visible=%d high=%d ", minSeverity, visible, high)
20 fmt.Printf("min=%d visible=%d high=%d\n", minSeverity3, visible2, high2)21}outputmin=3 visible=2 high=2