suramadu.tests.latency
Class AsynchronousEvent

java.lang.Object
  extended bysuramadu.tests.latency.AsynchronousEvent
All Implemented Interfaces:
java.lang.Runnable

public class AsynchronousEvent
extends java.lang.Object
implements java.lang.Runnable

PURPOSE: Measure the latency between the firing of an asynchronous event and the activation of its handler in the presence of other thread activity. Both bound and unbound event handlers may be used.

DESIGN: The primary thread takes a timestamp then fires an asynchronous event. The handler takes a timestamp when it is activated. A global index, maintained by the primary thread, is used to keep the trigger and handle times correctly paired. Data produced is the difference between the trigger and handler times. Memory, thread type, handler type, priorities and the amount of time the primary thread continues to operate are all configurable.

A variable number of background threads can be run. Each background thread produces a random amount of garbage (an array of integers with a random length).

ASSUMPTIONS:

INPUTS:

Property Default Value Description
"iterations" "100" Number of firing/handling tries
"priority" "200" Priority of the primary (firing) thread
"period" "100" Period (ms) of the primary thread
"idelay" "750" Initial delay (ms) of the primary thread
"threadtype" "RT" Primary thread type (regular java, RT or NHRT)
"memtype" "HEAP" Memory type for the primary thread
"bgpriority" "100" Background thread priority
"bgperiod" "100" Period (ms) of the background threads
"bgidelay" "400" Initial delay (ms) for the background threads
"backgroundthreads" "0" Number of background threads
"handlertype" "BOUND" Type of handler. Other possible value is 'UNBOUND'
"handlerpriority" "250" Priority of the handler
"handlernonheap" "TRUE" If handler should have properties of an NHRT. Other possible value is 'FALSE'. If handlertype is UNBOUND this value should be FALSE.
"waste" "0" Amount of time (ns) the primary thread should continue to run after firing the event.

OUTPUTS: Two data files: suramadu.tests.latency.AsynchronousEvent.(timestamp).latency and suramadu.tests.latency.AsynchronousEvent.(timestamp).SUMMARY

EXAMPLES:

ORIGINS:

Version:
$Revision: 1.1 $
Author:
Joseph Hutcherson

Nested Class Summary
static class AsynchronousEvent.TestProps
           
 
Field Summary
static int counter
          iteration counter
static javax.realtime.AsyncEvent event
          The event and handler
static javax.realtime.AsyncEventHandler handler
           
static long[] handlerStartTime
           
 MemoryType mt
          Memory type to use
 AsynchronousEvent.TestProps testProps
          Test properties for this run
static long[] triggerTime
          array for collecting timestamps during test
 ThreadType tt
          Thread type to use.
 
Constructor Summary
AsynchronousEvent()
          constructor for test class Instantiates testProperties.
AsynchronousEvent(AsynchronousEvent.TestProps props)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void run()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testProps

public AsynchronousEvent.TestProps testProps
Test properties for this run


tt

public ThreadType tt
Thread type to use.


mt

public MemoryType mt
Memory type to use


triggerTime

public static long[] triggerTime
array for collecting timestamps during test


handlerStartTime

public static long[] handlerStartTime

counter

public static int counter
iteration counter


event

public static javax.realtime.AsyncEvent event
The event and handler


handler

public static javax.realtime.AsyncEventHandler handler
Constructor Detail

AsynchronousEvent

public AsynchronousEvent()
                  throws java.lang.Exception
constructor for test class Instantiates testProperties.

Throws:
java.lang.Throwable
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.Exception

AsynchronousEvent

public AsynchronousEvent(AsynchronousEvent.TestProps props)
                  throws java.lang.Exception
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments

run

public void run()
Specified by:
run in interface java.lang.Runnable