diff --git a/src/main/java/com/ethlo/time/statistics/DurationPerformanceStatistics.java b/src/main/java/com/ethlo/time/statistics/DurationPerformanceStatistics.java index 50201a2..88a3257 100644 --- a/src/main/java/com/ethlo/time/statistics/DurationPerformanceStatistics.java +++ b/src/main/java/com/ethlo/time/statistics/DurationPerformanceStatistics.java @@ -75,6 +75,10 @@ public Duration getStandardDeviation() { final IndexedCollection list = collectionStatistics.getList(); final int count = list.size(); + if (count == 0) + { + return Duration.ZERO; + } final double average = getAverage().toNanos(); BigDecimal sd = BigDecimal.valueOf(0); for (long l : list) diff --git a/src/main/java/com/ethlo/time/statistics/ThroughputPerformanceStatistics.java b/src/main/java/com/ethlo/time/statistics/ThroughputPerformanceStatistics.java index 452ad18..ff38239 100644 --- a/src/main/java/com/ethlo/time/statistics/ThroughputPerformanceStatistics.java +++ b/src/main/java/com/ethlo/time/statistics/ThroughputPerformanceStatistics.java @@ -89,7 +89,7 @@ public Double getStandardDeviation() final int count = list.size(); if (count == 0) { - return null; + return 0D; } final double average = getAverage(); BigDecimal sd = BigDecimal.valueOf(0);