|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.faban.driver.util.timermeter.TimerMeter
public class TimerMeter
The TimerMeter code in large is a modification from Michael Kuperberg's
TimerMeter work. We thank him for this work.
Michael Kuperberg (mkuper@ipd.uka.de),
Chair for Software Design and Quality (SDQ),
Institute for Program Structures and Data Organisation (IPD),
Faculty of Informatics, University of Karlsruhe, Germany
http://sdq.ipd.uka.de
Field Summary | |
---|---|
protected int |
currentUpperLoopSizeBound
not private because needed in obtainMeasurementsUsingDirectInvocation |
int |
increased
Global variable used by the core algorithm. |
protected int |
iterationIncreaseStepWidth
See class description. |
protected long |
methodReturnAtMeasurementFinish
Protected because it must be set and read in subclasses' that override the obtainMeasurementsUsingDirectInvocation method |
protected long |
methodReturnAtMeasurementStart
protected because it must be set and read in subclasses' that override the obtainMeasurementsUsingDirectInvocation method |
protected int |
numberOfIterationIncreaseSteps
Actual maximum number of for loop iterations that are executed between two nanoTime invocations (cf. |
protected int |
numberOfMeasurements
See class description. |
protected int |
numberOfProcessRepetitions
Number of times the entire process is repeated. |
protected int |
numberOfWarmupTimerInvocations
See class description. |
protected static long |
publicDummy
This dummy variable is used for warmup; it is intentionally global because of JIT / dead code elimination prevention. |
protected String |
timerMethodName
TODO document assumption: parameterless and no class/package name! --> no parentheses: (){}[]<> and no "."s and ";" s |
protected String |
warningOnNegativeDiff
Warning message displayed when the timer value difference of two consecutive is negative. |
Constructor Summary | |
---|---|
TimerMeter(int warmupLoops,
int repeats,
int measurements,
int increaseWidth,
int increaseAfter,
int clusterThreshold)
|
Method Summary | |
---|---|
TimerCharacterisation |
computeTimerCharacterization(long[][] timerMeterMeasurements,
boolean logValues)
TODO engineer for performance: use one-dimensional array and work with offsets? |
static void |
main(String[] args)
Test main method. |
protected long[][] |
obtainMeasurementsUsingDirectInvocation()
THIS METHOD MUST BE OVERRIDDEN IN SUBCLASSES. |
String |
printTimerCharacterization()
|
void |
run()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static long publicDummy
protected int currentUpperLoopSizeBound
obtainMeasurementsUsingDirectInvocation
public int increased
protected int iterationIncreaseStepWidth
protected long methodReturnAtMeasurementFinish
obtainMeasurementsUsingDirectInvocation
method
protected long methodReturnAtMeasurementStart
obtainMeasurementsUsingDirectInvocation
method
protected int numberOfIterationIncreaseSteps
nanoTime
invocations (cf. class description)
protected int numberOfMeasurements
protected int numberOfProcessRepetitions
protected int numberOfWarmupTimerInvocations
protected String timerMethodName
protected final String warningOnNegativeDiff
Constructor Detail |
---|
public TimerMeter(int warmupLoops, int repeats, int measurements, int increaseWidth, int increaseAfter, int clusterThreshold)
Method Detail |
---|
public static void main(String[] args)
args
- Command line arguments, unused.public final TimerCharacterisation computeTimerCharacterization(long[][] timerMeterMeasurements, boolean logValues)
timerMeterMeasurements
- The measurement resultslogValues
- Whether to log values or not
protected long[][] obtainMeasurementsUsingDirectInvocation()
nanoTime
.
After "warming up" the timer method numberOfWarmupTimerInvocations
times, this
method measures the duration of a 'for' loop. The measurement is repeated
numberOfMeasurements
times for each loop iteration number from
0 to numberOfIterationIncreaseSteps
.
List
of measurementspublic String printTimerCharacterization()
public void run()
run
in interface Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |