org.htrace.impl
Class MilliSpan

java.lang.Object
  extended by org.htrace.impl.MilliSpan
All Implemented Interfaces:
Span

public class MilliSpan
extends Object
implements Span

A Span implementation that stores its information in milliseconds since the epoch.


Field Summary
 
Fields inherited from interface org.htrace.Span
ROOT_SPAN_ID
 
Constructor Summary
MilliSpan(String description, long traceId, long parentSpanId, long spanId, String processId)
           
 
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
protected  long currentTimeMillis()
           
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MilliSpan

public MilliSpan(String description,
                 long traceId,
                 long parentSpanId,
                 long spanId,
                 String processId)
Method Detail

child

public Span child(String description)
Description copied from interface: Span
Create a child span of this span with the given description

Specified by:
child in interface Span

stop

public void stop()
Description copied from interface: Span
The block has completed, stop the clock

Specified by:
stop in interface Span

currentTimeMillis

protected long currentTimeMillis()

isRunning

public boolean isRunning()
Description copied from interface: Span
Has the span been started and not yet stopped?

Specified by:
isRunning in interface Span

getAccumulatedMillis

public long getAccumulatedMillis()
Description copied from interface: Span
Return the total amount of time elapsed since start was called, if running, or difference between stop and start

Specified by:
getAccumulatedMillis in interface Span

toString

public String toString()
Specified by:
toString in interface Span
Overrides:
toString in class Object

getDescription

public String getDescription()
Description copied from interface: Span
Return a textual description of this span

Specified by:
getDescription in interface Span

getSpanId

public long getSpanId()
Description copied from interface: Span
A pseudo-unique (random) number assigned to this span instance

Specified by:
getSpanId in interface Span

getParentId

public long getParentId()
Description copied from interface: Span
Return the pseudo-unique (random) number of the parent span, returns ROOT_SPAN_ID if this is the root span

Specified by:
getParentId in interface Span

getTraceId

public long getTraceId()
Description copied from interface: Span
A pseudo-unique (random) number assigned to the trace associated with this span

Specified by:
getTraceId in interface Span

getStartTimeMillis

public long getStartTimeMillis()
Description copied from interface: Span
Get the start time, in milliseconds

Specified by:
getStartTimeMillis in interface Span

getStopTimeMillis

public long getStopTimeMillis()
Description copied from interface: Span
Get the stop time, in milliseconds

Specified by:
getStopTimeMillis in interface Span

addKVAnnotation

public void addKVAnnotation(byte[] key,
                            byte[] value)
Description copied from interface: Span
Add a data annotation associated with this span

Specified by:
addKVAnnotation in interface Span

addTimelineAnnotation

public void addTimelineAnnotation(String msg)
Description copied from interface: Span
Add a timeline annotation associated with this span

Specified by:
addTimelineAnnotation in interface Span

getKVAnnotations

public Map<byte[],byte[]> getKVAnnotations()
Description copied from interface: Span
Get data associated with this span (read only)

Specified by:
getKVAnnotations in interface Span

getTimelineAnnotations

public List<TimelineAnnotation> getTimelineAnnotations()
Description copied from interface: Span
Get any timeline annotations (read only)

Specified by:
getTimelineAnnotations in interface Span

getProcessId

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

Specified by:
getProcessId in interface Span
Returns:


Copyright © 2014. All Rights Reserved.