|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.proactive.benchmarks.timit.util.HierarchicalTimer
public class HierarchicalTimer
This class provide some methods to benchmark your applications.
Example of use : (TODO)
extends Timeable
Timer timer = new Timer();
timer.start(T_total);
timer.stop(T_total);
Stats stats = reduce(timer, rank, leader, groupSize);
org.objectweb.proactive.benchmarks.timit.examples
,
Serialized FormField Summary | |
---|---|
protected java.lang.String[] |
counter_name
|
protected int |
level
|
static int |
MAX_ENABLED_COUNTERS
|
protected int[] |
parent
|
protected int[] |
parentStarted
|
Constructor Summary | |
---|---|
HierarchicalTimer()
Create a timer with all counters enabled. |
Method Summary | |
---|---|
void |
activateCounters(TimerCounter[] counters,
TimItReductor tr)
Invoked by TimIt to activate only specified counters |
void |
addInstance(HierarchicalTimer t)
Adds a HierarchicalTimer instance to the arrayList. |
void |
addValue(int n,
int time)
|
java.lang.String |
getCounterName(int n)
Get the name of counter from his id |
protected static long |
getCtm()
Get currentTimeMillis() maybe one day we will be able to enhanced this call... |
int |
getElapsedTime(int n)
Returns the time in milliseconds elapsed since last start of this counter |
int |
getHierarchicalTime(int n)
Returns the total time in milliseconds of this counter for this hierarchy |
int |
getNbCounter()
Get the number of available counters |
HierarchicalTimerStatistics |
getStats()
This function must be called after all timers were collected. |
int |
getTotalTime(int n)
Returns the total time in milliseconds of this counter for all hierarchies |
boolean |
isStarted(int n)
Know if a counter is started or not |
static void |
printArray(double[][][] array,
java.lang.String[] counterName,
int n)
Prints a 3dim array of doubles, suppose that array was initialized with -1d values. |
int |
readTimer(int i,
int j,
int k)
Returns the value |
void |
resetCounter(int n)
Reset only one counter |
void |
resetTimer()
Reset the timing values |
void |
setValue(int n,
int time)
|
void |
start(int n)
Starts a counter. |
void |
startAsync(int n)
|
void |
stop(int n)
Stops the adequate counter. |
void |
stopAsync(int n)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_ENABLED_COUNTERS
protected int level
protected int[] parent
protected int[] parentStarted
protected java.lang.String[] counter_name
Constructor Detail |
---|
public HierarchicalTimer()
Method Detail |
---|
public void activateCounters(TimerCounter[] counters, TimItReductor tr)
counters
- the counters you want to specifytr
- the TimItReductor instancepublic void resetTimer()
public void resetCounter(int n)
n
- the counter idpublic void addInstance(HierarchicalTimer t)
t
- The HierarchicalTimer instance to add.public int getNbCounter()
public java.lang.String getCounterName(int n)
n
- the id of the counter
public boolean isStarted(int n)
n
- the id of the counter
public void start(int n)
n
- The integer that idetifies the timer to stop.public void startAsync(int n)
public void stop(int n)
n
- The integer that idetifies the timer to stop.public void stopAsync(int n)
public void setValue(int n, int time)
public void addValue(int n, int time)
public int readTimer(int i, int j, int k)
public int getElapsedTime(int n)
n
- the counter Id
public int getHierarchicalTime(int n)
n
- the counter Id
public int getTotalTime(int n)
n
- the counter Id
public java.lang.String toString()
toString
in class java.lang.Object
public HierarchicalTimerStatistics getStats()
public static void printArray(double[][][] array, java.lang.String[] counterName, int n)
array
- The 3 dim array of values to print.counterName
- The array of counter names.n
- The number of counters.protected static final long getCtm()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |