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.
| | |
| | | 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); |
| | | |
| | |
| | | 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); |