From 7c77f5ff23e4b0f8d5e189492bc4f25f847adc00 Mon Sep 17 00:00:00 2001 From: vlad Date: Thu, 13 Oct 2016 10:04:11 -0700 Subject: DIR-104 Fix GC stats collection --- src/main/scala/com/drivergrp/core/stats.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/scala/com/drivergrp/core/stats.scala b/src/main/scala/com/drivergrp/core/stats.scala index 963e4ea..2af4b6a 100644 --- a/src/main/scala/com/drivergrp/core/stats.scala +++ b/src/main/scala/com/drivergrp/core/stats.scala @@ -68,7 +68,7 @@ object stats { val (totalGarbageCollections, garbageCollectionTime) = ManagementFactory.getGarbageCollectorMXBeans.asScala.foldLeft(0L -> 0L) { case ((total, collectionTime), gc) => - (total + math.min(0L, gc.getCollectionCount)) -> (collectionTime + math.min(0L, gc.getCollectionTime)) + (total + math.max(0L, gc.getCollectionCount)) -> (collectionTime + math.max(0L, gc.getCollectionTime)) } GarbageCollectorStats(totalGarbageCollections, garbageCollectionTime) -- cgit v1.2.3