Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Fixed not to call super doAccounting()
Browse files Browse the repository at this point in the history
  • Loading branch information
myui committed Sep 9, 2014
1 parent 744bc8d commit bb2e7e2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/hivemall/mix/metrics/ThroughputCounter.java
Expand Up @@ -63,8 +63,6 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)

@Override
protected void doAccounting(TrafficCounter counter) {
super.doAccounting(counter);

long currentTime = System.currentTimeMillis();
long interval = currentTime - lastChacked.getAndSet(currentTime);
if(interval == 0) {
Expand All @@ -90,10 +88,10 @@ public String toString() {
TrafficCounter traffic = trafficCounter();
final StringBuilder buf = new StringBuilder(512);
long readThroughput = traffic.lastReadThroughput();
buf.append("Read Throughput: ").append(readThroughput / 1048576L).append(" MB/sec, ");
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 / 1048576L).append(" MB/sec\n");
buf.append("Write Throughput: ").append(writeThroughput / 1024).append(" KB/sec, ");
buf.append(lastWrites).append(" msg/sec\n");
return buf.toString();
}
Expand Down

0 comments on commit bb2e7e2

Please sign in to comment.