| Modifier and Type | Class and Description |
|---|---|
static class |
MilliSpan.Builder
The public interface for constructing a MilliSpan.
|
static class |
MilliSpan.MilliSpanDeserializer |
Span.SpanSerializer| Constructor and Description |
|---|
MilliSpan() |
| Modifier and Type | Method and Description |
|---|---|
void |
addKVAnnotation(String key,
String value)
Add a data annotation associated with this span
|
void |
addTimelineAnnotation(String msg)
Add a timeline annotation associated with this span
|
Span |
child(String childDescription)
Create a child span of this span with the given description
|
protected long |
currentTimeMillis() |
static MilliSpan |
fromJson(String json) |
long |
getAccumulatedMillis()
Return the total amount of time elapsed since start was called, if running,
or difference between stop and start
|
String |
getDescription()
Return a textual description of this span.
Will never be null.
|
Map<String,String> |
getKVAnnotations()
Get data associated with this span (read only)
Will never be null.
|
SpanId[] |
getParents()
Returns the parent IDs of the span.
The array will be empty if there are no parents.
|
SpanId |
getSpanId()
A pseudo-unique (random) number assigned to this span instance.
The spanId is immutable and cannot be changed.
|
long |
getStartTimeMillis()
Get the start time, in milliseconds
|
long |
getStopTimeMillis()
Get the stop time, in milliseconds
|
List<TimelineAnnotation> |
getTimelineAnnotations()
Get any timeline annotations (read only)
Will never be null.
|
String |
getTracerId()
Return a unique id for the process from which this Span originated.
Will never be null.
|
boolean |
isRunning()
Has the span been started and not yet stopped?
|
void |
setParents(SpanId[] parents)
Set the parents of this span.
Any existing parents will be cleared by this call.
|
void |
setTracerId(String tracerId)
Set the process id of a span.
|
void |
stop()
The block has completed, stop the clock
|
String |
toJson()
Serialize to Json
|
String |
toString() |
public Span child(String childDescription)
Spanpublic void stop()
Spanprotected long currentTimeMillis()
public boolean isRunning()
Spanpublic long getAccumulatedMillis()
SpangetAccumulatedMillis in interface Spanpublic String toString()
public String getDescription()
SpangetDescription in interface Spanpublic SpanId getSpanId()
Spanpublic SpanId[] getParents()
SpangetParents in interface Spanpublic void setParents(SpanId[] parents)
SpansetParents in interface Spanpublic long getStartTimeMillis()
SpangetStartTimeMillis in interface Spanpublic long getStopTimeMillis()
SpangetStopTimeMillis in interface Spanpublic void addKVAnnotation(String key, String value)
SpanaddKVAnnotation in interface Spanpublic void addTimelineAnnotation(String msg)
SpanaddTimelineAnnotation in interface Spanpublic Map<String,String> getKVAnnotations()
SpangetKVAnnotations in interface Spanpublic List<TimelineAnnotation> getTimelineAnnotations()
SpangetTimelineAnnotations in interface Spanpublic String getTracerId()
SpangetTracerId in interface Spanpublic void setTracerId(String tracerId)
SpansetTracerId in interface Spanpublic static MilliSpan fromJson(String json) throws IOException
IOExceptionCopyright © 2016 The Apache Software Foundation. All Rights Reserved.