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

Gaetan Boismal
01.10.2015 c1d4918c9d8d78f15ab8bf59f1a24490a0be40a2
OPENDJ-1983 OPENDJ-2246 PR-65 Fix xxxrate tools

If remote server is not responding or too slow, first percentiles can be uncomputed.
This cause 'null' value to be printed.
To avoid leaving null values at the end of the stats array, we need to
update the index after the percentiles loop.
1 files modified
2 ■■■■■ changed files
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java 2 ●●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
@@ -387,6 +387,7 @@
                final long intervalResultCount = intervalSuccessCount + intervalFailedCount;
                final String[] printableStats = new String[numColumns];
                Arrays.fill(printableStats, "-");
                printableStats[0] = getDivisionResult(intervalResultCount, intervalDurationSec, 1);
                printableStats[1] = getDivisionResult(totalResultCount, totalDurationSec, 1);
@@ -401,6 +402,7 @@
                for (int j = computedPercentiles.size() - 1; j >= 0; j--) {
                    printableStats[i++] = getDivisionResult(computedPercentiles.get(j) , 1000.0, 2);
                }
                i = 4 + percentiles.length;
                printableStats[i++] = getDivisionResult(intervalFailedCount, intervalDurationSec, 1);
                if (isAsync) {
                    printableStats[i++] = getDivisionResult(intervalOperationCount, intervalResultCount, 1);