|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.TimeTrace
public class TimeTrace
Cette classe permet de facilement trace le temps d'execution entre deux points usage
TimeTrace timeTrace = new TimeTrace(5000, 1000);
long start = timeTrace.getTime();
...
// do some work
...
timeTrace.add(start, "do some work");
System.out.println ("time: " + timeTrace.getCallCount());
CallAnalyse| Nested Class Summary | |
|---|---|
static class |
TimeTrace.CallStat
|
| Field Summary | |
|---|---|
protected Map<String,TimeTrace.CallStat> |
callCount
for each method of all proxies, keep number of call |
protected long |
timeToLogInfo
time to trigger log time in info level (ns) (default: 1s) |
protected long |
timeToLogWarn
time to trigger log time in warn level (ns) (default: 3s) |
| Constructor Summary | |
|---|---|
TimeTrace()
|
|
TimeTrace(long timeToLogInfo,
long timeToLogWarn)
|
|
| Method Summary | |
|---|---|
void |
add(long startNs,
long stopNs,
String methodName)
add new trace |
void |
add(long startNs,
String methodName)
add new trace, stop time is automaticaly computed |
Map<String,TimeTrace.CallStat> |
getCallCount()
|
static long |
getTime()
return time in format acceptable for #add(timeToLogInfo, timeToLogInfo, null) |
void |
setTimeToLogInfo(long timeToLogInfoMs)
|
void |
setTimeToLogWarn(long timeToLogWarnMs)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long timeToLogInfo
protected long timeToLogWarn
protected Map<String,TimeTrace.CallStat> callCount
| Constructor Detail |
|---|
public TimeTrace()
public TimeTrace(long timeToLogInfo,
long timeToLogWarn)
timeToLogInfo - time in milliseconde after that we log infotimeToLogWarn - time in milliseconde after that we log warn| Method Detail |
|---|
public void setTimeToLogInfo(long timeToLogInfoMs)
timeToLogInfoMs - time in milliseconde after that we log infopublic void setTimeToLogWarn(long timeToLogWarnMs)
timeToWarnInfoMs - time in milliseconde after that we log warnpublic Map<String,TimeTrace.CallStat> getCallCount()
public static long getTime()
#add(timeToLogInfo, timeToLogInfo, null)
public void add(long startNs,
String methodName)
startNs - time returned by getTime() methodmethodName - key name to store this time
public void add(long startNs,
long stopNs,
String methodName)
startNs - time returned by getTime() methodstopNs - time returned by getTime() methodmethodName - key name to store this time
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||