mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
01.35.2015 abfe565834b281f306e0df0e7bece3f7556d2728
OPENDJ-2246 Fix xxxrate tools NaN err/sec

If no errors are reported, it is ok to print that we have 0.0 err/sec.
If we have an interval duration equals to zero (it could append when tool start), this fix prevents us to print a 'NaN'.
1 files modified
4 ■■■ changed files
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java 4 ●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
@@ -403,7 +403,9 @@
                    printableStats[i++] = getDivisionResult(computedPercentiles.get(j) , 1000.0, 2);
                }
                i = 4 + percentiles.length;
                printableStats[i++] = getDivisionResult(intervalFailedCount, intervalDurationSec, 1);
                printableStats[i++] = intervalFailedCount == 0
                                      ? "0.0"
                                      : getDivisionResult(intervalFailedCount, intervalDurationSec, 1);
                if (isAsync) {
                    printableStats[i++] = getDivisionResult(intervalOperationCount, intervalResultCount, 1);
                }