org.apache.accumulo.cloudtrace.instrument
Interface Span

All Known Implementing Classes:
MilliSpan, NullSpan, RootMilliSpan

public interface Span

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


Field Summary
static long ROOT_SPAN_ID
           
 
Method Summary
 long accumulatedMillis()
          Return the total amount of time elapsed since start was called, if running, or difference between stop and start
 Span child(String description)
          Create a child span of this span with the given description
 void data(String key, String value)
          Add data associated with this span
 String description()
          Return a textual description of this span
 Map<String,String> getData()
          Get data associated with this span (read only)
 long getStartTimeMillis()
          Get the start time, in milliseconds
 long getStopTimeMillis()
          Get the stop time, in milliseconds
 Span parent()
          The parent span: returns null if this is the root span
 long parentId()
          Return the pseudo-unique (random) number of the parent span, returns ROOT_SPAN_ID if this is the root span
 boolean running()
          Has the span been started and not yet stopped?
 long spanId()
          A pseudo-unique (random) number assigned to this span instance
 void start()
          Begin gathering timing information
 void stop()
          The block has completed, stop the clock
 String toString()
           
 long traceId()
          A pseudo-unique (random) number assigned to the trace associated with this span
 

Field Detail

ROOT_SPAN_ID

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

start

void start()
Begin gathering timing information


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


accumulatedMillis

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


running

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


description

String description()
Return a textual description of this span


spanId

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


parent

Span parent()
The parent span: returns null if this is the root span


traceId

long traceId()
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

parentId

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


data

void data(String key,
          String value)
Add data associated with this span


getData

Map<String,String> getData()
Get data associated with this span (read only)



Copyright © 2012 The Apache Software Foundation. All Rights Reserved.