aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark
diff options
context:
space:
mode:
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/util/RollingAverage.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/util/RollingAverage.java b/spark-common/src/main/java/me/lucko/spark/common/util/RollingAverage.java
index 1e5e8b2..aa56f26 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/util/RollingAverage.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/util/RollingAverage.java
@@ -99,7 +99,7 @@ public class RollingAverage {
}
sortedSamples.sort(null);
- int rank = (int) Math.ceil((percentile / 100d) * sortedSamples.size());
+ int rank = (int) Math.ceil((percentile / 100d) * (sortedSamples.size() - 1));
return sortedSamples.get(rank).doubleValue();
}