|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsuramadu.tests.latency.InterruptLatency
The InterruptLatency class measures the minimum reaction time of the VM to corrective actions and clean-up when an AsynchronousInterruptedException is activated. The InterruptLatency class measures the latency of the activation of the interruptAction() method of an Interruptible when running as the target of an AsychronouslyInterruptedException.doInterruptible() method.
PURPOSE: Measure the time it takes to activate the interruptAction() method when an AIE.doInterruptible() is interrupted.
DESIGN: A Timed AIE is created within the context of an RT or NHRT thread and desired memory type. The start of the Timed is recorded and it polls for the current time until it exceeds its deadline and an asynchronous transfer of control (ATC) occurs and the interruptAction() method is activated. The interruptAction start time is recorded as well as the latest polled time from the Timed.run().
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: None.
INPUTS:
The following parameters may be specified in a properties file whose name is
of the form suramadu.tests.latency.InterruptLatency.properties .
Property | Default Value | Description |
---|---|---|
"memtype" | "IMMORTAL" | Memory type of the thread. Options are HEAP, SCOPE and IMMORTAL |
"threadtype" | "NHRT" | Type of thread to use. Valid options are RT and NHRT |
"iterations" | "100" | Number of samples to take |
"priority" | "200" | Priority of the thread |
"period" | "200" | Period of the thread |
"idelay" | "750" | Initial delay of the thread |
"bgthreads" | "0" | Number of background threads |
"bgpriority" | "100" | Priority of the background threads |
"bgperiod" | "100" | Period of the background threads |
"bgidelay" | "400" | Maximum value of random initial delay for background threads |
"histbins" | "50" | |
"costmillis" | "10" | Cost of the thread, in milliseconds, added to costnanos |
"costnanos" | "0" | Cost of the thread, in nanoseconds, added to constmillis |
"deadlinemillis" | "10" | Deadline of the thread, in milliseconds, added to deadlinenanos |
"deadlinenanos" | "0" | Deadline of the thread, in nanoseconds, added to deadlinemillis |
"waste" | "11000000" | Amount of time for the thread to waste each period, in nanoseconds |
OUTPUTS: The following output files will be produced. The file name prefix follows standard Suramadu output file naming conventions.
File suffix | Description |
---|---|
latencyFromStartPlusDeadline | Calculated latency: start time of handler - (start time of thread + deadline). This gives an idea how precise the interrupt mechanism is in an absolute (theoretical) sense. |
latencyFromStop | Direct latency: start time of handler - last polled time of thread. This is a relative latency, indicating how quickly the process happens, but does not provide an absolute time reference (i.e. was the fault detected in a timely fashion?). |
handlerJitter | Relative jitter of handler start times |
primaryStartJitter | Relative jitter of the thread start time |
primaryStopJitter | Relative jitter of the thread's last polled time |
actualCost | The difference between the start time of the thread and the last polled time. The expectation is that this should be equal to the value of the deadline property. With the latencyFromStop this should provide information on the overall deterministic nature of the interrupt mechanism. |
SUMMARY | Overall latency statistics |
EXAMPLES:
ORIGINS:
Nested Class Summary | |
static class |
InterruptLatency.TestProps
|
Field Summary | |
static int |
counter
iteration counter |
static long[] |
handlerStart
|
MemoryType |
mt
Memory type to use |
static javax.realtime.PeriodicParameters |
params
|
static java.lang.Thread |
primary
Keep this declaration fairly high level, and cast to appropriate class when necessary |
static long[] |
primaryStart
|
static long[] |
primaryStop
Timestamp arrays |
static javax.realtime.RelativeTime |
rtCost
Handlers and parameters |
static javax.realtime.RelativeTime |
rtDeadline
|
static javax.realtime.RelativeTime |
rtPeriod
|
static javax.realtime.RelativeTime |
rtStart
|
static InterruptLatency.TestProps |
testProps
Test properties for this run |
ThreadType |
tt
Thread type to use. |
Constructor Summary | |
InterruptLatency()
constructor for test class Instantiates testProperties. |
|
InterruptLatency(InterruptLatency.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 static InterruptLatency.TestProps testProps
public ThreadType tt
public MemoryType mt
public static long[] primaryStop
public static long[] primaryStart
public static long[] handlerStart
public static int counter
public static javax.realtime.RelativeTime rtCost
public static javax.realtime.RelativeTime rtDeadline
public static javax.realtime.RelativeTime rtStart
public static javax.realtime.RelativeTime rtPeriod
public static javax.realtime.PeriodicParameters params
public static java.lang.Thread primary
Constructor Detail |
public InterruptLatency() throws java.lang.Exception
java.lang.Throwable
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.Exception
public InterruptLatency(InterruptLatency.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 |