org.apache.accumulo.cloudtrace.instrument.impl
Class MilliSpan

java.lang.Object
  extended by org.apache.accumulo.cloudtrace.instrument.impl.MilliSpan
All Implemented Interfaces:
Span
Direct Known Subclasses:
RootMilliSpan

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.apache.accumulo.cloudtrace.instrument.Span
ROOT_SPAN_ID
 
Constructor Summary
MilliSpan(String description, long id, Span parent)
           
 
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
protected  long currentTimeMillis()
           
 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
 
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 id,
                 Span parent)
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

start

public void start()
Description copied from interface: Span
Begin gathering timing information

Specified by:
start 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()

running

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

Specified by:
running in interface Span

accumulatedMillis

public long accumulatedMillis()
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:
accumulatedMillis in interface Span

toString

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

description

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

Specified by:
description in interface Span

spanId

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

Specified by:
spanId in interface Span

parent

public Span parent()
Description copied from interface: Span
The parent span: returns null if this is the root span

Specified by:
parent in interface Span

parentId

public long parentId()
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:
parentId in interface Span

traceId

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

Specified by:
traceId 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

data

public void data(String key,
                 String value)
Description copied from interface: Span
Add data associated with this span

Specified by:
data in interface Span

getData

public Map<String,String> getData()
Description copied from interface: Span
Get data associated with this span (read only)

Specified by:
getData in interface Span


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