modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/nhttp/util/ConnectionsView.java [155:177]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected void notifyMessageSize(long size, boolean isRequest) {
        // This logic gets executed for each and every transaction. For a typical
        // mediation scenario this method will be called 4 times. Therefore I'm using
        // arrays of integers to keep the overhead down to a minimum. Since the number
        // of buckets is 6, this can be easily managed without using a slow data structure
        // like a HashMap. This approach guarantees O(1) complexity.

        AtomicInteger[] counters = isRequest ? requestSizeCounters : responseSizeCounters;

        if (size < 1024) {
            counters[LESS_THAN_1K].incrementAndGet();
        } else if (size < 10240) {
            counters[LESS_THAN_10K].incrementAndGet();
        } else if (size < 102400) {
            counters[LESS_THAN_100K].incrementAndGet();
        } else if (size < 1048576) {
            counters[LESS_THAN_1M].incrementAndGet();
        } else if (size < 10485760) {
            counters[LESS_THAN_10M].incrementAndGet();
        } else {
            counters[GREATER_THAN_10M].incrementAndGet();
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/jmx/ConnectionsView.java [148:170]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected void notifyMessageSize(long size, boolean isRequest) {
        // This logic gets executed for each and every transaction. For a typical
        // mediation scenario this method will be called 4 times. Therefore I'm using
        // arrays of integers to keep the overhead down to a minimum. Since the number
        // of buckets is 6, this can be easily managed without using a slow data structure
        // like a HashMap. This approach guarantees O(1) complexity.

        AtomicInteger[] counters = isRequest ? requestSizeCounters : responseSizeCounters;

        if (size < 1024) {
            counters[LESS_THAN_1K].incrementAndGet();
        } else if (size < 10240) {
            counters[LESS_THAN_10K].incrementAndGet();
        } else if (size < 102400) {
            counters[LESS_THAN_100K].incrementAndGet();
        } else if (size < 1048576) {
            counters[LESS_THAN_1M].incrementAndGet();
        } else if (size < 10485760) {
            counters[LESS_THAN_10M].incrementAndGet();
        } else {
            counters[GREATER_THAN_10M].incrementAndGet();
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



