public class MessageCountMeter extends OnePointMeter
MessageCountMeter
can be attached to a port to count messages. The
useMessage(Message)
method can be overridden to count only those
messages that satisfy certain criteria, e.g., based on message content, or
message type.portHandler
Modifier | Constructor and Description |
---|---|
protected |
MessageCountMeter(UnweightedSampleCollector<java.lang.Void> statistic) |
Modifier and Type | Method and Description |
---|---|
static MessageCountMeter |
createWithVoidStatistic(UnweightedSampleCollector<java.lang.Void> statistic)
creates a new
MessageCountMeter with a statistic that accepts no
parameters |
protected void |
evaluateMessage(Message msg,
Port port) |
protected void |
evaluateSample(Message msg)
called when a message was seen
|
protected boolean |
useMessage(Message msg)
filters messages that should be used for counting
|
attachInput, attachInput
protected MessageCountMeter(UnweightedSampleCollector<java.lang.Void> statistic)
public static MessageCountMeter createWithVoidStatistic(UnweightedSampleCollector<java.lang.Void> statistic)
MessageCountMeter
with a statistic that accepts no
parametersstatistic
- statisticMessageCountMeter
protected void evaluateSample(Message msg)
msg
- the messageprotected boolean useMessage(Message msg)
msg
- the observed messageprotected void evaluateMessage(Message msg, Port port)
evaluateMessage
in class OnePointMeter