public interface MethodTrace
A method trace.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(MethodTrace trace) void
appendTo
(StringBuilder builder) Appends this method trace along with any children to the given StringBuilder.children()
void
Completes this method trace.long
duration()
Returns the duration of the method call this entry represents in nanoseconds, this value is 0 or undefined until the trace has been completed.message()
method()
static MethodTrace
methodTrace
(String method, @Nullable String message) toString
(int indentation) Returns a string representation of this method trace.
-
Method Details
-
method
String method()- Returns:
- the name of the method being traced
-
message
- Returns:
- the trace message
-
duration
long duration()Returns the duration of the method call this entry represents in nanoseconds, this value is 0 or undefined until the trace has been completed.- Returns:
- the duration of the method call this trace represents
-
children
List<MethodTrace> children()- Returns:
- the child method traces
-
appendTo
Appends this method trace along with any children to the given StringBuilder.- Parameters:
builder
- the StringBuilder to append to.
-
toString
Returns a string representation of this method trace.- Parameters:
indentation
- the number of tab indents to prefix the string with- Returns:
- a string representation of this method trace
-
addChild
- Parameters:
trace
- the child trace to add- Throws:
IllegalStateException
- in case this trace is already completed
-
complete
Completes this method trace.- Parameters:
exception
- the exception, if anymessage
- the exit message, if any- Throws:
IllegalStateException
- in case this trace is completed
-
methodTrace
- Parameters:
method
- the method to tracemessage
- the message, if any- Returns:
- a new
MethodTrace
instance
-