T
- Type of the value that the metric is measuring.S
- Where this is getting its Message
s from.public interface MessageMetric<T extends Number,S extends MessageProducer<S>> extends MessageConsumer<S>
MessageProducer
. These classes are intended for measuring only, and
will therefore not store the Message
s that have passed through them.Modifier and Type | Method and Description |
---|---|
Future<Message> |
expect(C condition)
Will return a future that will only return when a message arrives that
makes the given condition return true.
|
Future<Message> |
expect(C condition,
MessageAction<S> action)
Will return a future that will only return when a message arrives that
makes the given condition return true, at which point it asynchronously
executes a particular action.
|
MessageMeasure<T,S> |
getMeasure()
Retrieves the measure that is used to produce the value of this metric.
|
long |
getMessageCount()
Retrieve the number of times that the metric has been invoked on a
Message . |
long |
getMessageCount(Message timestamp)
Retrieve the number of times that the metric has been invoked on a
Message , at the time immediately after a given message has been
processed. |
S |
getSource()
Retrieve the instance that is responsible for notifying this metric of
new
Message s- |
T |
getValue()
Retrieve the value of this metric, which is a sum of the return values of
all of this metric's
MessageMeasure invocations. |
T |
getValue(Message timestamp)
Retrieve the value of this metric, which is a sum of the return values of
all of this metric's
MessageMeasure invocations, at the time
immediately after a given message has been processed. |
Message |
waitFor(C condition)
Deprecated.
|
Message |
waitFor(C condition,
long timeout,
TimeUnit unit)
Deprecated.
|
isStopped, stop
messageReceived
MessageMeasure<T,S> getMeasure()
long getMessageCount()
Message
.long getMessageCount(Message timestamp)
Message
, at the time immediately after a given message has been
processed.timestamp
- The point in time after this message was processed.S getSource()
Message
s-T getValue()
MessageMeasure
invocations.T getValue(Message timestamp)
MessageMeasure
invocations, at the time
immediately after a given message has been processed.timestamp
- The point in time after this message was processed. Null will
retrieve the initial state.MessageMeasure.initialValue()
. Null
is returned in case no such message was ever processed by this
metric.Future<Message> expect(C condition)
condition
- Condition that needs to be true for the future to unblock.IllegalStateException
- When already #isStopped()
.Future<Message> expect(C condition, MessageAction<S> action)
condition
- Condition that needs to be true for the future to unblock.action
- Action to execute when the condition becomes true.IllegalStateException
- When already #isStopped()
.@Deprecated Message waitFor(C condition)
condition
- Condition that needs to be true for the method to unblock.IllegalStateException
- When already #isStopped()
.@Deprecated Message waitFor(C condition, long timeout, TimeUnit unit)
condition
- Condition that needs to be true for the method to unblock.timeout
- Time before forcibly aborting.unit
- Unit of time.IllegalStateException
- When already #isStopped()
.Copyright © 2014. All rights reserved.