suramadu.tests.latency
Class JNIOverhead

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

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

The JNIOverhead class measures the overhead involved in making a simple JNI call.

PURPOSE: This test is particularly pertinent in calculating the error of high-resolution time measurement. Since it takes time to measure time, the results of this test can be used to correct for this overhead.

DESIGN: The JNI native method to retrieve CPU machine cycles is called repeatedly, and the value logged in an array. The differences between the first and all subsequent, consecutive calls is calculated, and statistical calculations made from these values. Since each difference represents the time it takes to return from the JNI call and then call it again, the total value can be considered the entire JNI call overhead even though it was measured in the reverse order as is considered normal.

ASSUMPTIONS: No attempt is made in this test to measure specific JNI callback or data copying methodologies.

INPUTS:

Property Default Value Description
"iterations" "1000"

OUTPUTS: The output contains the maximum, minimum, median, mean, standard deviation and mode statistical measurements on the collected data.

EXAMPLES: None.

ORIGINS: This test was conceived and written by JPL and the Golden Gate Team.

Version:
$Id: JNIOverhead.html,v 1.1 2004/09/23 15:28:52 mbi Exp $
Author:
Mark Indictor


Nested Class Summary
static class JNIOverhead.TestProps
           
 
Field Summary
static int DEFAULT_ITERATIONS
          Default number of iterations
static MemoryType mt
          the memory areay in which to run
static JNIOverhead.TestProps testProps
          actual properties used by this test run.
static ThreadType tt
          the thread type to run in
 
Constructor Summary
JNIOverhead()
          constructor for test class Instantiates testProperties.
JNIOverhead(JNIOverhead.TestProps props)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void run()
          The run() method does the setup and launcing of the actual test code
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ITERATIONS

public static final int DEFAULT_ITERATIONS
Default number of iterations

See Also:
Constant Field Values

mt

public static MemoryType mt
the memory areay in which to run


tt

public static ThreadType tt
the thread type to run in


testProps

public static JNIOverhead.TestProps testProps
actual properties used by this test run. Filled in from default and specified properties at class instantiation.

Constructor Detail

JNIOverhead

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

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

JNIOverhead

public JNIOverhead(JNIOverhead.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()
The run() method does the setup and launcing of the actual test code

Specified by:
run in interface java.lang.Runnable