public class RequestTrace extends Object implements Serializable, Comparable<RequestTrace>
Constructor and Description |
---|
RequestTrace() |
Modifier and Type | Method and Description |
---|---|
void |
addEvent(RequestTraceSpan span)
Add a new event to the series being traced
|
void |
addEvent(RequestTraceSpan span,
long timestampMillis) |
void |
addSpanLog(RequestTraceSpanLog spanLog) |
int |
compareTo(RequestTrace requestTrace) |
void |
endTrace() |
void |
endTrace(long timestampMillis) |
boolean |
equals(Object o) |
long |
getElapsedTime()
Gets how long the trace took.
|
Instant |
getEndTime()
Gets the end time of the request trace in milliseconds since the epoch
(midnight, January 1st 1970).
|
Instant |
getStartTime()
Gets the Instant when the span was started
See
Instant.now() for how this time is generated. |
UUID |
getTraceId()
Returns a unique identifier for the trace,
which comes from the first event.
|
LinkedList<RequestTraceSpan> |
getTraceSpans()
Returns a list of all the events that make up the trace.
|
int |
hashCode() |
boolean |
isCompleted()
Returns true if a complete trace has finished
|
boolean |
isStarted()
Returns true if a trace has started.
|
void |
setTraceId(UUID newID) |
String |
toString() |
public void addEvent(RequestTraceSpan span)
span
- public void addEvent(RequestTraceSpan span, long timestampMillis)
public void endTrace()
public void endTrace(long timestampMillis)
public long getElapsedTime()
public boolean isStarted()
public LinkedList<RequestTraceSpan> getTraceSpans()
public Instant getStartTime()
Instant.now()
for how this time is generated.public Instant getEndTime()
This value is 0 until the request trace in finished.
public UUID getTraceId()
null
if no trace startedpublic void setTraceId(UUID newID)
public boolean isCompleted()
public void addSpanLog(RequestTraceSpanLog spanLog)
public int compareTo(RequestTrace requestTrace)
compareTo
in interface Comparable<RequestTrace>
Copyright © 2020. All rights reserved.