From 9273228db49ed58a01aa2ef97be8c16bb82a3058 Mon Sep 17 00:00:00 2001 From: Adrien Suree Date: Tue, 26 Sep 2017 18:37:48 +0200 Subject: [PATCH] Use floor to get completion percentages instead of rounding --- .../main/scala/com/criteo/cuttle/timeseries/TimeSeriesApp.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesApp.scala b/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesApp.scala index 8d8547f1a..6179c69d9 100644 --- a/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesApp.scala +++ b/timeseries/src/main/scala/com/criteo/cuttle/timeseries/TimeSeriesApp.scala @@ -318,7 +318,7 @@ private[timeseries] trait TimeSeriesApp { self: TimeSeriesScheduler => val newDone = if (isDone) duration else 0L (totalDuration + duration, doneDuration + newDone, isAnyStuck || isStuck) } - val completion = Math.rint((done.toDouble / total.toDouble)*10)/10 + val completion = Math.floor((done.toDouble / total.toDouble)*10)/10 val correctedCompletion = if (completion == 0 && done != 0) 0.1 else completion