diff --git a/app/models/overview/Node.scala b/app/models/overview/Node.scala index f82d480b..5b6629d6 100644 --- a/app/models/overview/Node.scala +++ b/app/models/overview/Node.scala @@ -59,8 +59,10 @@ object Node extends NodeInfo { } def cpuPercent(nodeStats: JsValue): JsNumber = { - val cpu = (nodeStats \ "os" \ "cpu" \ "percent").asOpt[Int].getOrElse(// 5.X - (nodeStats \ "os" \ "cpu_percent").asOpt[Int].getOrElse(0) // FIXME 2.X + val cpu = (nodeStats \ "os" \ "cpu" \ "percent").asOpt[Int].filter(i => i > 0).getOrElse(// 5.X + (nodeStats \ "process" \ "cpu" \ "percent").asOpt[Int].filter(i => i > 0).getOrElse( // 7.X + (nodeStats \ "os" \ "cpu_percent").asOpt[Int].getOrElse(0) // FIXME 2.X + ) ) JsNumber(BigDecimal(cpu)) } diff --git a/public/overview.html b/public/overview.html index b84e0bdd..69d60e79 100644 --- a/public/overview.html +++ b/public/overview.html @@ -75,6 +75,12 @@ +