|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.util.MethodProfiler
public class MethodProfiler
Records the times that it takes to call methods. Allows one simultaneous method call per thread (no nested calls). Uses java's nano second timer. Results are logged by method name.
| Nested Class Summary | |
|---|---|
static class |
MethodProfiler.Result
The results of sampling for a single method. |
| Constructor Summary | |
|---|---|
MethodProfiler()
|
|
| Method Summary | |
|---|---|
void |
enter(String methodName)
Notes that the calling thread has entered the given method and records the time stamp. |
void |
exit(String methodName)
Notes that the calling thread has exited the given method and records the time delta since entry. |
void |
exitAndClear(String methodName)
Clears out the profile for the current thread, and invokes the exit of the top-level method. |
Map<String,MethodProfiler.Result> |
getResults()
Gets all method results so far. |
static void |
main(String[] args)
Runs some very basic tests of the method profiler. |
void |
reset()
Clears all recorded methods and times. |
void |
swap(String methodName)
Transition to a new method or segment. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodProfiler()
| Method Detail |
|---|
public static void main(String[] args)
throws InterruptedException
InterruptedExceptionpublic Map<String,MethodProfiler.Result> getResults()
public void enter(String methodName)
public void exit(String methodName)
enter(java.lang.String) for the calling thread.
public void swap(String methodName)
public void exitAndClear(String methodName)
exit(java.lang.String).
public void reset()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||