Methods Summary |
---|
public int | getInterval()
return interval;
|
public void | messageReceived(org.apache.catalina.tribes.ChannelMessage msg)
if ( rxStart == 0 ) rxStart = System.currentTimeMillis();
long bytes = XByteBuffer.getDataPackageLength(((ChannelData)msg).getDataPackageLength());
mbRx += ((double)bytes)/(1024d*1024d);
msgRxCnt.addAndGet(1);
if ( msgRxCnt.get() % interval == 0 ) report(timeTx);
super.messageReceived(msg);
|
public void | report(double timeTx)
StringBuffer buf = new StringBuffer("ThroughputInterceptor Report[\n\tTx Msg:");
buf.append(msgTxCnt).append(" messages\n\tSent:");
buf.append(df.format(mbTx));
buf.append(" MB (total)\n\tSent:");
buf.append(df.format(mbAppTx));
buf.append(" MB (application)\n\tTime:");
buf.append(df.format(timeTx));
buf.append(" seconds\n\tTx Speed:");
buf.append(df.format(mbTx/timeTx));
buf.append(" MB/sec (total)\n\tTxSpeed:");
buf.append(df.format(mbAppTx/timeTx));
buf.append(" MB/sec (application)\n\tError Msg:");
buf.append(msgTxErr).append("\n\tRx Msg:");
buf.append(msgRxCnt);
buf.append(" messages\n\tRx Speed:");
buf.append(df.format(mbRx/((double)((System.currentTimeMillis()-rxStart)/1000))));
buf.append(" MB/sec (since 1st msg)\n\tReceived:");
buf.append(df.format(mbRx)).append(" MB]\n");
if ( log.isInfoEnabled() ) log.info(buf);
|
public void | sendMessage(org.apache.catalina.tribes.Member[] destination, org.apache.catalina.tribes.ChannelMessage msg, org.apache.catalina.tribes.group.InterceptorPayload payload)
if ( access.addAndGet(1) == 1 ) txStart = System.currentTimeMillis();
long bytes = XByteBuffer.getDataPackageLength(((ChannelData)msg).getDataPackageLength());
try {
super.sendMessage(destination, msg, payload);
}catch ( ChannelException x ) {
msgTxErr.addAndGet(1);
access.addAndGet(-1);
throw x;
}
mbTx += ((double)(bytes*destination.length))/(1024d*1024d);
mbAppTx += ((double)(bytes))/(1024d*1024d);
if ( access.addAndGet(-1) == 0 ) {
long stop = System.currentTimeMillis();
timeTx += ( (double) (stop - txStart)) / 1000d;
if ((msgTxCnt.get() / interval) >= lastCnt) {
lastCnt++;
report(timeTx);
}
}
msgTxCnt.addAndGet(1);
|
public void | setInterval(int interval)
this.interval = interval;
|