public class ThroughputInterceptor extends ChannelInterceptorBase implements ThroughputInterceptorMBean
ChannelInterceptor.InterceptorEvent
Modifier and Type | Field and Description |
---|---|
protected static StringManager |
sm |
optionFlag
Constructor and Description |
---|
ThroughputInterceptor() |
Modifier and Type | Method and Description |
---|---|
int |
getInterval() |
double |
getLastCnt() |
double |
getMbAppTx() |
double |
getMbRx() |
double |
getMbTx() |
AtomicLong |
getMsgRxCnt() |
AtomicLong |
getMsgTxCnt() |
AtomicLong |
getMsgTxErr() |
long |
getRxStart() |
double |
getTimeTx() |
long |
getTxStart() |
void |
messageReceived(ChannelMessage msg)
the
messageReceived is invoked when a message is received. |
void |
report(double timeTx) |
void |
sendMessage(Member[] destination,
ChannelMessage msg,
InterceptorPayload payload)
The
sendMessage method is called when a message is being sent to one more destinations. |
void |
setInterval(int interval) |
fireInterceptorEvent, getChannel, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, heartbeat, memberAdded, memberDisappeared, okToProcess, setChannel, setNext, setOptionFlag, setPrevious, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOptionFlag
protected static final StringManager sm
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException
ChannelInterceptor
sendMessage
method is called when a message is being sent to one more destinations.
The interceptor can modify any of the parameters and then pass on the message down the stack by
invoking getNext().sendMessage(destination,msg,payload)
getNext().sendMessage(destination,msg,payload)
sendMessage
in interface ChannelInterceptor
sendMessage
in class ChannelInterceptorBase
destination
- Member[] - the destination for this messagemsg
- ChannelMessage - the message to be sentpayload
- InterceptorPayload - the payload, carrying an error handler and future useful data, can be nullChannelException
- if a serialization error happens.ErrorHandler
,
InterceptorPayload
public void messageReceived(ChannelMessage msg)
ChannelInterceptor
messageReceived
is invoked when a message is received.
ChannelMessage.getAddress()
is the sender, or the reply-to address
if it has been overwritten.messageReceived
in interface ChannelInterceptor
messageReceived
in class ChannelInterceptorBase
msg
- ChannelMessagepublic void report(double timeTx)
report
in interface ThroughputInterceptorMBean
public void setInterval(int interval)
setInterval
in interface ThroughputInterceptorMBean
public int getInterval()
getInterval
in interface ThroughputInterceptorMBean
public double getLastCnt()
getLastCnt
in interface ThroughputInterceptorMBean
public double getMbAppTx()
getMbAppTx
in interface ThroughputInterceptorMBean
public double getMbRx()
getMbRx
in interface ThroughputInterceptorMBean
public double getMbTx()
getMbTx
in interface ThroughputInterceptorMBean
public AtomicLong getMsgRxCnt()
getMsgRxCnt
in interface ThroughputInterceptorMBean
public AtomicLong getMsgTxCnt()
getMsgTxCnt
in interface ThroughputInterceptorMBean
public AtomicLong getMsgTxErr()
getMsgTxErr
in interface ThroughputInterceptorMBean
public long getRxStart()
getRxStart
in interface ThroughputInterceptorMBean
public double getTimeTx()
getTimeTx
in interface ThroughputInterceptorMBean
public long getTxStart()
getTxStart
in interface ThroughputInterceptorMBean
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.