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

Gaetan Boismal
01.10.2015 f73e7a4b630567c546bb89a2e72259d2b1eb7ebe
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-sdk/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/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);