seda.sandStorm.test.bench.stage_latency
Class TimerHandler

java.lang.Object
  extended by seda.sandStorm.test.bench.stage_latency.TimerHandler
All Implemented Interfaces:
EventHandlerIF

public class TimerHandler
extends java.lang.Object
implements EventHandlerIF


Nested Class Summary
(package private)  class TimerHandler.myEvent
           
 
Field Summary
private  TimerHandler.myEvent[] burst
           
private  int BURST_SIZE
           
private static boolean DEBUG
           
private  int DELAY_TIME
           
private  int EVENT_SIZE
           
private  int LATENCY_MEASUREMENT_SIZE
           
private  int MEASUREMENT_SIZE
           
private  SinkIF mysink
           
private  SinkIF nextHandlerSink
           
private  int NUM_STAGES
           
private  int numCompletions
           
private  long t1
           
private  long t2
           
private  ssTimer timer
           
 
Constructor Summary
TimerHandler()
           
 
Method Summary
 void destroy()
          Called when an event handler is destroyed.
 void handleEvent(QueueElementIF item)
          Handle the event corresponding to the given QueueElementIF.
 void handleEvents(QueueElementIF[] items)
          Handle the events corresponding to the given QueueElementIF array.
 void init(ConfigDataIF config)
          Called when an event handler is initialized.
private  void printBW()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

nextHandlerSink

private SinkIF nextHandlerSink

mysink

private SinkIF mysink

timer

private ssTimer timer

DELAY_TIME

private int DELAY_TIME

NUM_STAGES

private int NUM_STAGES

BURST_SIZE

private int BURST_SIZE

EVENT_SIZE

private int EVENT_SIZE

MEASUREMENT_SIZE

private int MEASUREMENT_SIZE

LATENCY_MEASUREMENT_SIZE

private int LATENCY_MEASUREMENT_SIZE

burst

private TimerHandler.myEvent[] burst

numCompletions

private int numCompletions

t1

private long t1

t2

private long t2
Constructor Detail

TimerHandler

public TimerHandler()
Method Detail

init

public void init(ConfigDataIF config)
          throws java.lang.Exception
Description copied from interface: EventHandlerIF
Called when an event handler is initialized. This method should perform any initialization operations as required by the application.

Specified by:
init in interface EventHandlerIF
Parameters:
config - The set of configuration parameters for the stage.
Throws:
java.lang.Exception - The EventHandler can indicate an error to the runtime during initialization by throwing an Exception.

destroy

public void destroy()
Description copied from interface: EventHandlerIF
Called when an event handler is destroyed. This method should perform any cleanup or shutdown operations as required by the application before the event handler is removed from the system.

Specified by:
destroy in interface EventHandlerIF

handleEvent

public void handleEvent(QueueElementIF item)
Description copied from interface: EventHandlerIF
Handle the event corresponding to the given QueueElementIF. This method is invoked by the system when a single event is pending for the event handler.

Specified by:
handleEvent in interface EventHandlerIF

handleEvents

public void handleEvents(QueueElementIF[] items)
Description copied from interface: EventHandlerIF
Handle the events corresponding to the given QueueElementIF array. This method is invoked when multiple events are pending for the event handler. The application may reorder, filter, or drop these events if it wishes to do so.

Specified by:
handleEvents in interface EventHandlerIF

printBW

private void printBW()