|
||||||||||
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.TraceSessionRootStep
public class TraceSessionRootStep
Root trace step for ITraceSession
.
Each trace session contains one implicit trace step that serves as root of the tree of "real" trace steps. The duration of this trace step is by definition the accumulated duration of all children. In additon, the isolated duration of this step is by definion 0ms.
In practice, an instance of the root step represents a complete service call. The children of the root step are the single execution steps of the service.
A root step can savely be added as child to any other trace step (e.g. if a client invokes a remote service, the root step of the service can be added to any trace step of the client). However, if a client spawns multiple services asynchronously and waits until all of them return, the isolated duration of the client step will return a meaningless value (since the overall processing time of the parallel services exceeds the execution time of the client step).
This class is only instantiated by implementations of
ITraceSession
Field Summary |
---|
Fields inherited from class org.e2etrace.trace.AbstractTraceStep |
---|
children |
Constructor Summary | |
---|---|
TraceSessionRootStep(TraceSessionRootStepId id)
Constructor. |
Method Summary | |
---|---|
void |
enter()
Enter the trace step and start time measuring. |
long |
getDuration()
Returns the overall duration of this TraceStep and all children. |
long |
getIsolatedDuration()
The isolated duration of the root step is by definition 0ms. |
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. |
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, toString, wait, wait, wait |
Constructor Detail |
---|
public TraceSessionRootStep(TraceSessionRootStepId id)
id
- ID of the root stepMethod Detail |
---|
public long getDuration()
getDuration
in interface ITraceStep
getDuration
in class AbstractTraceStep
public long getIsolatedDuration()
getIsolatedDuration
in interface ITraceStep
getIsolatedDuration
in class AbstractTraceStep
leave
has not
been called yet)public void enter() throws IllegalStateException
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
IllegalStateException
public boolean isActive()
The session root step is always active by definition.
isActive
in interface ITraceStep
isActive
in class AbstractTraceStep
public void leave() throws IllegalStateException
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
IllegalStateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |