|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.util.perf.AbstractPerformanceMonitor
org.alfresco.util.perf.PerformanceMonitor
public class PerformanceMonitor
Enables begin ... end style performance monitoring with summarisation using the performance logging category. It is designed to only incur a minor cost when performance logging is turned on using the DEBUG logging mechanism. See base class for details on enabling the performance logging categories.
This class is thread safe.
Usage:
private PerformanceMonitor somethingTimer = new PerformanceMonitor("mytest", "doSomething"); ... ... private void doSomething() { somethingTimer.start(); ... ... somethingTimer.stop(); }
Constructor Summary | |
---|---|
PerformanceMonitor(java.lang.String entityName,
java.lang.String methodName)
|
Method Summary | |
---|---|
void |
start()
Threadsafe method to start the timer. |
void |
stop()
Threadsafe method to stop the timer. |
Methods inherited from class org.alfresco.util.perf.AbstractPerformanceMonitor |
---|
isDebugEnabled, recordStats |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PerformanceMonitor(java.lang.String entityName, java.lang.String methodName)
entityName
- name of the entity, e.g. a test name or a bean name against which to
log the performancemethodName
- the method for which the performance will be loggedMethod Detail |
---|
public void start()
The timer is only started if the logging levels are enabled.
PerformanceMonitor.stop()
public void stop()
PerformanceMonitor.start()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |