org.htrace
Interface Span

All Known Implementing Classes:
MilliSpan

public interface Span

Base interface for gathering and reporting statistics about a block of execution.

Spans form a tree structure with the parent relationship. The first span in a trace has no parent span.


Field Summary
static long ROOT_SPAN_ID
           
 
Method Summary
 void addKVAnnotation(byte[] key, byte[] value)
          Add a data annotation associated with this span
 void addTimelineAnnotation(String msg)
          Add a timeline annotation associated with this span
 Span child(String description)
          Create a child span of this span with the given description
 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
 Map<byte[],byte[]> getKVAnnotations()
          Get data associated with this span (read only)
 long getParentId()
          Return the pseudo-unique (random) number of the parent span, returns ROOT_SPAN_ID if this is the root span
 String getProcessId()
          Return a unique id for the node or process from which this Span originated.
 long getSpanId()
          A pseudo-unique (random) number assigned to this span instance
 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)
 long getTraceId()
          A pseudo-unique (random) number assigned to the trace associated with this span
 boolean isRunning()
          Has the span been started and not yet stopped?
 void stop()
          The block has completed, stop the clock
 String toString()
           
 

Field Detail

ROOT_SPAN_ID

static final long ROOT_SPAN_ID
See Also:
Constant Field Values
Method Detail

stop

void stop()
The block has completed, stop the clock


getStartTimeMillis

long getStartTimeMillis()
Get the start time, in milliseconds


getStopTimeMillis

long getStopTimeMillis()
Get the stop time, in milliseconds


getAccumulatedMillis

long getAccumulatedMillis()
Return the total amount of time elapsed since start was called, if running, or difference between stop and start


isRunning

boolean isRunning()
Has the span been started and not yet stopped?


getDescription

String getDescription()
Return a textual description of this span


getSpanId

long getSpanId()
A pseudo-unique (random) number assigned to this span instance


getTraceId

long getTraceId()
A pseudo-unique (random) number assigned to the trace associated with this span


child

Span child(String description)
Create a child span of this span with the given description


toString

String toString()
Overrides:
toString in class Object

getParentId

long getParentId()
Return the pseudo-unique (random) number of the parent span, returns ROOT_SPAN_ID if this is the root span


addKVAnnotation

void addKVAnnotation(byte[] key,
                     byte[] value)
Add a data annotation associated with this span


addTimelineAnnotation

void addTimelineAnnotation(String msg)
Add a timeline annotation associated with this span


getKVAnnotations

Map<byte[],byte[]> getKVAnnotations()
Get data associated with this span (read only)


getTimelineAnnotations

List<TimelineAnnotation> getTimelineAnnotations()
Get any timeline annotations (read only)


getProcessId

String getProcessId()
Return a unique id for the node or process from which this Span originated. IP address is a reasonable choice.

Returns:


Copyright © 2014. All Rights Reserved.