Package kieker.analysis.generic
Class CountingStage<T>
java.lang.Object
teetime.framework.AbstractStage
teetime.framework.AbstractConsumerStage<T>
kieker.analysis.generic.CountingStage<T>
- Type Parameters:
T
- record type
public final class CountingStage<T>
extends teetime.framework.AbstractConsumerStage<T>
An instance of this class receives any objects, increments an intern thread-safe counter without printing any message and delivers the
unchanged objects to the output. The value of the counter can be retrieved by connected to the respective output port using a
corresponding method.
- Since:
- 1.4
- Author:
- Jan Waller, Nils Christian Ehmke, Lars Bluemke
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CountingStage(boolean echo, int modulo)
Creates a new instance of this class and sets the time stamp of initialization.CountingStage(boolean echo, int modulo, java.lang.String label)
Creates a new instance of this class and sets the time stamp of initialization. -
Method Summary
Modifier and Type Method Description protected void
execute(T event)
This method represents the input port of this filter.teetime.framework.OutputPort<java.lang.Long>
getCountOutputPort()
long
getMessageCount()
Returns the number of objects received until now.teetime.framework.OutputPort<T>
getRelayedEventsOutputPort()
Methods inherited from class teetime.framework.AbstractConsumerStage
createInputPort, execute, getInputPort
Methods inherited from class teetime.framework.AbstractStage
abort, addInputPortRemovedListener, addOutputPortRemovedListener, compareAndSetBeingExecuted, createInputPort, createInputPort, createInputPort, createOutputPort, createOutputPort, createOutputPort, createOutputPort, declareActive, declarePassive, executeByFramework, getCurrentState, getId, getInputPorts, getOutputPorts, getOwningThread, getTerminationStrategy, isActive, isBeingExecuted, isPaused, isProducer, isStateless, onSignal, onStarting, onTerminating, onValidating, removeDynamicPort, removeDynamicPort, setPaused, setStateless, shouldBeTerminated, signalAlreadyReceived, terminateStage, toString, workCompleted
-
Constructor Details
-
CountingStage
public CountingStage(boolean echo, int modulo)Creates a new instance of this class and sets the time stamp of initialization.- Parameters:
echo
- if true, print out number of counted record to console log (INFO)modulo
- print out count info to log only every n-event
-
CountingStage
public CountingStage(boolean echo, int modulo, java.lang.String label)Creates a new instance of this class and sets the time stamp of initialization.- Parameters:
echo
- if true, print out number of counted record to console log (INFO)modulo
- print out count info to log only every n-eventlabel
- label added as prefix to the number in the log
-
-
Method Details
-
getMessageCount
public final long getMessageCount()Returns the number of objects received until now.- Returns:
- The current counter value.
-
execute
This method represents the input port of this filter.- Specified by:
execute
in classteetime.framework.AbstractConsumerStage<T>
- Parameters:
event
- The next event.
-
getCountOutputPort
public teetime.framework.OutputPort<java.lang.Long> getCountOutputPort() -
getRelayedEventsOutputPort
-