|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsuramadu.tests.latency.AsynchronousEvent
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:
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 |
public AsynchronousEvent.TestProps testProps
public ThreadType tt
public MemoryType mt
public static long[] triggerTime
public static long[] handlerStartTime
public static int counter
public static javax.realtime.AsyncEvent event
public static javax.realtime.AsyncEventHandler handler
Constructor Detail |
public AsynchronousEvent() throws java.lang.Exception
java.lang.Throwable
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.Exception
public AsynchronousEvent(AsynchronousEvent.TestProps props) throws java.lang.Exception
Method Detail |
public static void main(java.lang.String[] args)
args
- the command line argumentspublic void run()
run
in interface java.lang.Runnable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |