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

Gaetan Boismal
26.07.2016 17fa2de27062a70b4fd337f27c670b9019c990a1
OPENDJ-2968 Prevent console flooding for xxxrate tools

If we compute a negative response time, we catch the runtime exception
raised by HdrHistogram in order to prevent flooding console with stack
trace.
1 files modified
7 ■■■■ changed files
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/StatsThread.java 7 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/StatsThread.java
@@ -390,9 +390,12 @@
    }
    void addResponseTime(final long responseTimeNs) {
        if (!warmingUp) {
            waitDurationNsCount.inc(responseTimeNs);
        // The computed response time might be negative if the difference between the two
        // System.nanoTime() calls (Just before sending the request and right after receiving the response)
        // is incoherent. See OPENDJ-2968 for more details.
        if (!warmingUp && responseTimeNs >= 0) {
            responseTimes.update(responseTimeNs);
            waitDurationNsCount.inc(responseTimeNs);
        }
    }