public interface TraceEntry
TransactionService.startTraceEntry(MessageSupplier, TimerName)
for how to create and
use TraceEntry
instances.Modifier and Type | Method and Description |
---|---|
void |
end()
End the entry.
|
void |
endWithError(String message)
End the entry and mark the trace entry as an error with the specified throwable.
|
void |
endWithError(String message,
Throwable t)
End the entry and add the specified
errorMessage to the entry. |
void |
endWithError(Throwable t)
End the entry and mark the trace entry as an error with the specified throwable.
|
void |
endWithStackTrace(long threshold,
TimeUnit unit)
End the entry and capture a stack trace if its total time exceeds the specified
threshold . |
Timer |
extend()
Example of query and subsequent iterating over results which goes back to database and pulls
more results.
|
MessageSupplier |
getMessageSupplier()
Returns the
MessageSupplier that was supplied when the TraceEntry was
created. |
void end()
void endWithStackTrace(long threshold, TimeUnit unit)
threshold
.
In case the trace has accumulated maxTraceEntriesPerTransaction
entries and this is a
dummy entry and its total time exceeds the specified threshold, then this dummy entry is
escalated into a real entry. A hard cap (maxTraceEntriesPerTransaction * 2
) on the
total number of (real) entries is applied when escalating dummy entries to real entries.void endWithError(Throwable t)
Throwable#getMessage()
.
If this is the root entry, then the error flag on the transaction is set.
In case the transaction has accumulated maxTraceEntriesPerTransaction
entries and
this is a dummy entry, then this dummy entry is escalated into a real entry. A hard cap (
maxTraceEntriesPerTransaction * 2
) on the total number of (real) entries is applied
when escalating dummy entries to real entries.void endWithError(@Nullable String message)
endWithStackTrace(long, TimeUnit)
. Unless this is
the root trace entry in which case no location stack trace is captured / displayed (since
location stack trace is typically not mysterious for root trace entries).
If this is the root entry, then the error flag on the transaction is set.
In case the transaction has accumulated maxTraceEntriesPerTransaction
entries and
this is a dummy entry, then this dummy entry is escalated into a real entry. A hard cap (
maxTraceEntriesPerTransaction * 2
) on the total number of (real) entries is applied
when escalating dummy entries to real entries.void endWithError(@Nullable String message, Throwable t)
errorMessage
to the entry.
If message
is empty or null, then the error message text is captured from
Throwable#getMessage()
.
If this is the root entry, then the error flag on the transaction is set.
In case the transaction has accumulated maxTraceEntriesPerTransaction
entries and
this is a dummy entry, then this dummy entry is escalated into a real entry. A hard cap (
maxTraceEntriesPerTransaction * 2
) on the total number of (real) entries is applied
when escalating dummy entries to real entries.Timer extend()
@Nullable MessageSupplier getMessageSupplier()
MessageSupplier
that was supplied when the TraceEntry
was
created.
This can be useful (for example) to retrieve the MessageSupplier
in @
OnReturn
so that the return value can be added to the message produced by the
MessageSupplier
.
This returns the MessageSupplier
even if the trace has accumulated
maxTraceEntriesPerTransaction
entries and this is a dummy entry.
Under some error conditions this can return null
.Copyright © 2011–2015 Glowroot contributors. All rights reserved.