Count incidents visible at a selected minimum severity.

incident queue Small severity lists make queue thresholds visible without using external incident systems.

Incident Queue Reliability Report

minSeverity
incident_queue.php
Replay: real traced execution (multi-file project)
<?php
$minSeverity = 2;
$visible = 0;
$high = 0;

foreach ([1, 2, 3, 3] as $severity) {
    if ($severity >= $minSeverity) {
        $visible = $visible + 1;
    }
    if ($severity >= 3) {
        $high = $high + 1;
    }
}

echo "min=" . $minSeverity . " visible=" . $visible . " high=" . $high . "\n";
<?php
$minSeverity = 1;
$visible = 0;
$high = 0;

foreach ([1, 2, 3, 3] as $severity) {
    if ($severity >= $minSeverity) {
        $visible = $visible + 1;
    }
    if ($severity >= 3) {
        $high = $high + 1;
    }
}

echo "min=" . $minSeverity . " visible=" . $visible . " high=" . $high . "\n";
<?php
$minSeverity = 3;
$visible = 0;
$high = 0;

foreach ([1, 2, 3, 3] as $severity) {
    if ($severity >= $minSeverity) {
        $visible = $visible + 1;
    }
    if ($severity >= 3) {
        $high = $high + 1;
    }
}

echo "min=" . $minSeverity . " visible=" . $visible . " high=" . $high . "\n";
  1. $minSeverity ← 2, $visible ← 0, $high ← 0

    1<?php2$minSeverity→ 2 = 2; //@minSeverity=1, 33$visible→ 0 = 0;4$high→ 0 = 0;
  2. foreach ([1, 2, 3, 3] as $severity)

    pass 1 of 4
    6foreach ([1, 2, 3, 3] as $severity1) {7    if ($severity >= $minSeverity) {8        $visible = $visible + 1;
    All 4 passes — pass 1 is the card above
    pass$severity$high
    11
    22
    330 1
    431 2
  3. $visible ← 1

    pass 1 of 3
    6foreach ([1, 2, 3, 3] as $severity) {7    if ($severity2 >= $minSeverity2) {8        $visible→ 1 = $visible + 1;9    }
    All 3 passes — pass 1 is the card above
    pass$severity$visible$high
    120 1
    231 20 1
    332 31 2
  4. $high ← 1

    pass 1 of 2
    9}10if ($severity3 >= 3) {11    $high→ 1 = $high + 1;12}
  5. $high ← 2

    pass 2 of 2
    9}10if ($severity3 >= 3) {11    $high→ 2 = $high + 1;12}
  6. echo "min=" . $minSeverity . " visible=" . $visible . " high=" . $high…

    15echo "min=" . $minSeverity2 . " visible=" . $visible3 . " high=" . $high2 . "\n";
    outputmin=2 visible=3 high=2
  1. $minSeverity ← 1, $visible ← 0, $high ← 0

    1<?php2$minSeverity→ 1 = 1;3$visible→ 0 = 0;4$high→ 0 = 0;
  2. foreach ([1, 2, 3, 3] as $severity)

    pass 1 of 4
    6foreach ([1, 2, 3, 3] as $severity1) {7    if ($severity >= $minSeverity) {8        $visible = $visible + 1;
    All 4 passes — pass 1 is the card above
    pass$severity$high
    11
    22
    330 1
    431 2
  3. $visible ← 1

    pass 1 of 4
    6foreach ([1, 2, 3, 3] as $severity) {7    if ($severity1 >= $minSeverity1) {8        $visible→ 1 = $visible + 1;9    }
    All 4 passes — pass 1 is the card above
    pass$severity$visible$high
    110 1
    221 2
    332 30 1
    433 41 2
  4. $high ← 1

    pass 1 of 2
    9}10if ($severity3 >= 3) {11    $high→ 1 = $high + 1;12}
  5. $high ← 2

    pass 2 of 2
    9}10if ($severity3 >= 3) {11    $high→ 2 = $high + 1;12}
  6. echo "min=" . $minSeverity . " visible=" . $visible . " high=" . $high…

    15echo "min=" . $minSeverity1 . " visible=" . $visible4 . " high=" . $high2 . "\n";
    outputmin=1 visible=4 high=2
  1. $minSeverity ← 3, $visible ← 0, $high ← 0

    1<?php2$minSeverity→ 3 = 3;3$visible→ 0 = 0;4$high→ 0 = 0;
  2. foreach ([1, 2, 3, 3] as $severity)

    pass 1 of 4
    6foreach ([1, 2, 3, 3] as $severity1) {7    if ($severity >= $minSeverity) {8        $visible = $visible + 1;
    All 4 passes — pass 1 is the card above
    pass$severity$minSeverity$visible$high
    11
    22
    3330 10 1
    4331 21 2
  3. $visible ← 1

    pass 1 of 2
    6foreach ([1, 2, 3, 3] as $severity) {7    if ($severity3 >= $minSeverity3) {8        $visible→ 1 = $visible + 1;9    }
  4. $high ← 1

    pass 1 of 2
    9}10if ($severity3 >= 3) {11    $high→ 1 = $high + 1;12}
  5. $visible ← 2

    pass 2 of 2
    6foreach ([1, 2, 3, 3] as $severity) {7    if ($severity3 >= $minSeverity3) {8        $visible→ 2 = $visible + 1;9    }
  6. $high ← 2

    pass 2 of 2
    9}10if ($severity3 >= 3) {11    $high→ 2 = $high + 1;12}
  7. echo "min=" . $minSeverity . " visible=" . $visible . " high=" . $high…

    15echo "min=" . $minSeverity3 . " visible=" . $visible2 . " high=" . $high2 . "\n";
    outputmin=3 visible=2 high=2