Package de.hybris.platform.util
Class TimeTracer
java.lang.Object
de.hybris.platform.util.TimeTracer
- All Implemented Interfaces:
Serializable
usage: create a hierarchy of time tracers
execute that task you want to have traces, starting and stopping the tracers (a child tracer must only be running if its parent is running)
if you want a intermediate report, call
call
execute that task you want to have traces, starting and stopping the tracers (a child tracer must only be running if its parent is running)
if you want a intermediate report, call
printReport()call
finishAll() in the root tracer after the task has finished, to get a final report
instead of creating a hierarchy of tracers, you can call start(String) with a path expression, which will
create children automatically
to get reports automatically after n calls to stop(), call setAutoReport(int)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Constructor Summary
ConstructorsConstructorDescriptionTimeTracer(String description) TimeTracer(String description, TimeTracer parent) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidstatic Objectexecute(String key, int autoreport, TimeTracer.TraceBody body) voidfinish()voidprotected TimeTracerstatic TimeTracergetInstance(String name, int autoreport) protected TimeTracergetOrCreateChild(String childName) protected StringlonggetTime()voidprintInstanceReport(int indent) voidprotected voidprintReport(int indent) voidsetAutoReport(int autoReportPeriod) voidstart()voidvoidstop()void
-
Constructor Details
-
TimeTracer
-
TimeTracer
-
-
Method Details
-
getInstance
-
getTime
public long getTime() -
getOrCreateChild
-
getChild
-
start
-
start
public void start() -
checkParentStateWhenAdding
protected void checkParentStateWhenAdding() -
stop
-
stop
public void stop() -
checkParentStateWhenRemoving
protected void checkParentStateWhenRemoving() -
finish
public void finish() -
finishAll
public void finishAll() -
getPathName
-
printInstanceReport
public void printInstanceReport(int indent) -
printReport
public void printReport() -
printReport
protected void printReport(int indent) -
setAutoReport
public void setAutoReport(int autoReportPeriod) - Parameters:
autoReportPeriod- set to a value smaller than 1 to turn autoreport off
-
execute
public static Object execute(String key, int autoreport, TimeTracer.TraceBody body) throws Exception - Throws:
Exception
-