Count visible incidents and high-severity incidents from a small queue.

Incident Queue Reliability Report

IncidentQueueReliabilityReport.scala
object Main {
  def main(args: Array[String]): Unit = {
    val minSeverity = 
    val severities = List(1, 2, 3, 3)
    var visible = 0
    var high = 0

    for (severity <- severities) {
      if (severity >= minSeverity) {
        visible = visible + 1
      }
      if (severity >= 3) {
        high = high + 1
      }
    }

    println("min=" + minSeverity)
    println("visible=" + visible)
    println("high=" + high)
  }
}
object Main {
  def main(args: Array[String]): Unit = {
    val minSeverity = 
    val severities = List(1, 2, 3, 3)
    var visible = 0
    var high = 0

    for (severity <- severities) {
      if (severity >= minSeverity) {
        visible = visible + 1
      }
      if (severity >= 3) {
        high = high + 1
      }
    }

    println("min=" + minSeverity)
    println("visible=" + visible)
    println("high=" + high)
  }
}
object Main {
  def main(args: Array[String]): Unit = {
    val minSeverity = 
    val severities = List(1, 2, 3, 3)
    var visible = 0
    var high = 0

    for (severity <- severities) {
      if (severity >= minSeverity) {
        visible = visible + 1
      }
      if (severity >= 3) {
        high = high + 1
      }
    }

    println("min=" + minSeverity)
    println("visible=" + visible)
    println("high=" + high)
  }
}
incident-queue-report Counting with a loop makes the threshold and the visible queue size explicit.