Package kieker.analysis.generic.time
Class AbstractTimestampFilter<T>
java.lang.Object
teetime.framework.AbstractStage
teetime.framework.AbstractConsumerStage<T>
kieker.analysis.generic.time.AbstractTimestampFilter<T>
- Type Parameters:
T
- Generic type of incoming records. Subclasses use concrete types.
- Direct Known Subclasses:
EventRecordTimestampFilter
,MonitioringRecordTimestampFilter
,OperationExecutionRecordTimestampFilter
,TraceMetadataTimestampFilter
public abstract class AbstractTimestampFilter<T>
extends teetime.framework.AbstractConsumerStage<T>
Allows to filter monitoring records objects based on their given timestamps.
If the received record is within the defined timestamps, the object is delivered unmodified to the nameWithinPeriodOutputPort otherwise to the
nameOutsidePeriodOutputPort.
In a concrete P&F architecture this stage should be used behind TeeTime's InstanceOfFilter to forward records to either
TraceMetadataTimestampFilter
, OperationExecutionRecordTimestampFilter
or MonitioringRecordTimestampFilter
.- Since:
- 1.2
- Author:
- Andre van Hoorn, Jan Waller, Lars Bluemke
-
Field Summary
Fields Modifier and Type Field Description protected teetime.framework.OutputPort<T>
recordOutsideTimePeriodOutputPort
protected teetime.framework.OutputPort<T>
recordWithinTimePeriodOutputPort
-
Constructor Summary
Constructors Constructor Description AbstractTimestampFilter(long ignoreBeforeTimestamp, long ignoreAfterTimestamp)
Creates a new instance of this class using the given parameters. -
Method Summary
Modifier and Type Method Description protected void
execute(T record)
teetime.framework.OutputPort<T>
getRecordOutsideTimePeriodOutputPort()
protected abstract long
getRecordSpecificTimestamp(T record)
Returns the most accurate timestamp available for each record.teetime.framework.OutputPort<T>
getRecordWithinTimePeriodOutputPort()
protected boolean
inRange(long timestamp)
A simple helper method which checks whether the given timestamp is in the configured limits.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
-
Field Details
-
Constructor Details
-
AbstractTimestampFilter
public AbstractTimestampFilter(long ignoreBeforeTimestamp, long ignoreAfterTimestamp)Creates a new instance of this class using the given parameters.- Parameters:
ignoreBeforeTimestamp
- The lower limit for the time stamps of the records.ignoreAfterTimestamp
- The upper limit for the time stamps of the records.
-
-
Method Details
-
inRange
protected final boolean inRange(long timestamp)A simple helper method which checks whether the given timestamp is in the configured limits.- Parameters:
timestamp
- The timestamp to be checked.- Returns:
- true if and only if the given timestamp is between or equals ignoreBeforeTimestamp and ignoreAfterTimestamp.
-
execute
- Specified by:
execute
in classteetime.framework.AbstractConsumerStage<T>
-
getRecordSpecificTimestamp
Returns the most accurate timestamp available for each record. This might be record.getTimestamp or record.getLoggingTimestamp.- Parameters:
record
- An EventRecord, OperationExecutionRecord, TraceMetadata or MonitoringRecord for example.- Returns:
- Timestamp of the given record.
-
getRecordWithinTimePeriodOutputPort
-
getRecordOutsideTimePeriodOutputPort
-