|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.e2etrace.trace.AbstractTraceStep org.e2etrace.trace.DefaultTraceStep
public class DefaultTraceStep
Default ITraceStep
implementation.
Trace steps may be serialized to remote clients. Please note that after
serializiation enter()
and leave()
should be called
anymore (the methods will handle this case gracefully and print a warning
message).
To enable logging of the trace-calls just set the log level for this class to
DEBUG
. For example, in a log4j configuration file the following
entry activates log output for every call to enter()
and
leave()
:
log4j.category.e2etrace.trace.DefaultTraceStep = DEBUG
Field Summary |
---|
Fields inherited from class org.e2etrace.trace.AbstractTraceStep |
---|
children |
Method Summary | |
---|---|
void |
enter()
Enter the trace step and start time measuring. |
long |
getDuration()
Returns the duration of this TraceStep and all children. |
long |
getIsolatedDuration()
Returns the isolated duration of this TraceStep. |
boolean |
isActive()
Checks, if the current trace step is active. |
void |
leave()
Leave the trace step and calculate the elapsed time since enter has been called. |
String |
toString()
Override toString. |
Methods inherited from class org.e2etrace.trace.AbstractTraceStep |
---|
addChild, equals, getChildren, getId, getParent, hashCode, leaveAllChildren, setParent |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void enter()
This method should only be called once for a trace step. All subsequent calls will be ignored.
enter
in interface ITraceStep
enter
in class AbstractTraceStep
public void leave()
enter
has been called.
The elapsed time is returned by getDuration()
.
Leaving a step implies that all children are left, too.
This method should only be called once for a trace step. All subsequent calls will be ignored.
leave
in interface ITraceStep
leave
in class AbstractTraceStep
public boolean isActive()
A step is active between the calls to enter
and
leave
.
isActive
in interface ITraceStep
isActive
in class AbstractTraceStep
public long getDuration()
This value reflects the overall execution time of a trace step between the
calls to enter
and leave
inclusive the
durations of all children.
getDuration
in interface ITraceStep
getDuration
in class AbstractTraceStep
public long getIsolatedDuration()
The duration is the time elapsed between the calls to enter
and leave
minus the durations of all children.
Please note that the returned value only reflects the real execution time,
if all children of this trace step really have been executed. That is, if
trace steps are added manually, getIsolatedDuration()
will
return meaningless values. An example for this scenario are traces that are
collected from parallel execution threads and manually added to the trace
step of the method that spawned the threads.
getIsolatedDuration
in interface ITraceStep
getIsolatedDuration
in class AbstractTraceStep
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |