public interface TraceEntry
PluginServices.startTraceEntry(MessageSupplier, TimerName) for how to create and use
TraceEntry instances.| Modifier and Type | Method and Description |
|---|---|
void |
end()
End the entry.
|
void |
endWithError(ErrorMessage errorMessage)
End the entry and add the specified
errorMessage to the entry. |
void |
endWithStackTrace(long threshold,
TimeUnit unit)
End the entry and capture a stack trace if its duration 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 duration 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(ErrorMessage errorMessage)
errorMessage to the entry.
If this is the root entry, then the error flag on the trace is set. Traces can be filtered by
their error flag on the trace explorer page.
In case the trace 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.