Package io.netty.handler.traffic

Examples of io.netty.handler.traffic.TrafficCounter$TrafficMonitoring


        long readsPerSec = (lastReads / interval) * 1000;
        long writesPerSec = (lastWrites / interval) * 1000;
        metrics.setLastReads(readsPerSec);
        metrics.setLastWrites(writesPerSec);

        TrafficCounter traffic = trafficCounter();
        long readThroughput = traffic.lastReadThroughput();
        long writeThroughput = traffic.lastWriteThroughput();
        metrics.setReadThroughput(readThroughput);
        metrics.setWriteThroughput(writeThroughput);

        if(logger.isInfoEnabled()) {
            if(lastReads > 0 || lastWrites > 0) {
View Full Code Here


        }
    }

    @Override
    public String toString() {
        TrafficCounter traffic = trafficCounter();
        final StringBuilder buf = new StringBuilder(512);
        long readThroughput = traffic.lastReadThroughput();
        buf.append("Read Throughput: ").append(readThroughput / 1024L).append(" KB/sec, ");
        buf.append(lastReads).append(" msg/sec\n");
        long writeThroughput = traffic.lastWriteThroughput();
        buf.append("Write Throughput: ").append(writeThroughput / 1024).append(" KB/sec, ");
        buf.append(lastWrites).append(" msg/sec");
        return buf.toString();
    }
View Full Code Here

TOP

Related Classes of io.netty.handler.traffic.TrafficCounter$TrafficMonitoring

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.