Class AbstractCurrentTimeEventGenerationFilter<T>

java.lang.Object
teetime.framework.AbstractStage
teetime.framework.AbstractConsumerStage<T>
kieker.analysis.generic.time.AbstractCurrentTimeEventGenerationFilter<T>
Type Parameters:
T - Type parameter for this abstract class concrete implementations may use Long or IMonitoringRecord.
Direct Known Subclasses:
RecordCurrentTimeEventGenerationFilter, TimestampCurrentTimeEventGenerationFilter

public abstract class AbstractCurrentTimeEventGenerationFilter<T>
extends teetime.framework.AbstractConsumerStage<T>
Generates time events with a given resolution based on the timestamps of incoming IMonitoringRecords.
  1. The first record received immediately leads to a new TimestampRecord with the given timestamp.
  2. The timestamp of the first record is stored as firstTimestamp and future events are generated at firstTimestamp + i * timerResolution.
  3. Future IMonitoringRecord may lead to future TimestampRecord as follows:
    1. A newly incoming IMonitoringRecord with logging timestamp tstamp leads to the new timer events satisfying firstTimestamp + i * timerResolution < tstamp.
It is guaranteed that the generated timestamps are in ascending order.
Since:
1.3
Author:
Andre van Hoorn, Lars Bluemke
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected teetime.framework.OutputPort<TimestampRecord> currentTimeRecordOutputPort
    The output port for TimestampRecords.
    protected teetime.framework.OutputPort<java.lang.Long> currentTimeValueOutputPort
    The output port for Long timestamps.
    protected long firstTimestamp
    Timestamp of the record that was received first.
    protected long maxTimestamp
    Maximum timestamp received so far.
    protected long mostRecentEventFired
    The timestamp of the most recent timer event.
    protected long timerResolution
    The timer resolution used.

    Fields inherited from class teetime.framework.AbstractConsumerStage

    inputPort

    Fields inherited from class teetime.framework.AbstractStage

    logger
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractCurrentTimeEventGenerationFilter​(long timerResolution)
    Creates an event generator which generates time events with the given resolution in timeunits.
  • Method Summary

    Modifier and Type Method Description
    protected abstract void execute​(T element)
    This method represents the input port for new records or raw timestamps.
    teetime.framework.OutputPort<TimestampRecord> getCurrentTimeRecordOutputPort()  
    teetime.framework.OutputPort<java.lang.Long> getCurrentTimeValueOutputPort()  

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • firstTimestamp

      protected volatile long firstTimestamp
      Timestamp of the record that was received first. Notice, that this is not necessarily the lowest timestamp.
    • maxTimestamp

      protected volatile long maxTimestamp
      Maximum timestamp received so far.
    • mostRecentEventFired

      protected volatile long mostRecentEventFired
      The timestamp of the most recent timer event.
    • timerResolution

      protected final long timerResolution
      The timer resolution used.
    • currentTimeRecordOutputPort

      protected final teetime.framework.OutputPort<TimestampRecord> currentTimeRecordOutputPort
      The output port for TimestampRecords.
    • currentTimeValueOutputPort

      protected final teetime.framework.OutputPort<java.lang.Long> currentTimeValueOutputPort
      The output port for Long timestamps.
  • Constructor Details

    • AbstractCurrentTimeEventGenerationFilter

      public AbstractCurrentTimeEventGenerationFilter​(long timerResolution)
      Creates an event generator which generates time events with the given resolution in timeunits.
      Parameters:
      timerResolution - The timer resolution used
  • Method Details

    • execute

      protected abstract void execute​(T element)
      This method represents the input port for new records or raw timestamps.
      Specified by:
      execute in class teetime.framework.AbstractConsumerStage<T>
      Parameters:
      element - The incoming record or timestamp.
    • getCurrentTimeRecordOutputPort

      public teetime.framework.OutputPort<TimestampRecord> getCurrentTimeRecordOutputPort()
    • getCurrentTimeValueOutputPort

      public teetime.framework.OutputPort<java.lang.Long> getCurrentTimeValueOutputPort()