java.lang.Object
org.eclipse.microprofile.opentracing.tck.tracer.TestSpan
All Implemented Interfaces:
io.opentracing.Span

public class TestSpan extends Object implements io.opentracing.Span
Test Tracer.
  • Constructor Details

    • TestSpan

      public TestSpan()
      Create blank span.
    • TestSpan

      public TestSpan(String operationName, Map<String,Object> tags, List<Map<String,?>> logEntries)
      Create span with a particular kind and operation name.
      Parameters:
      operationName - Operation name
      tags - Tags associated with span
      logEntries - Log entries
  • Method Details

    • getStartMicros

      public long getStartMicros()
      Start time of the span.
      Returns:
      the startMicros
    • setStartMicros

      public void setStartMicros(long newSartMicros)
      Set the start time of the span.
      Parameters:
      newSartMicros - the startMicros to set
    • getFinishMicros

      public long getFinishMicros()
      End time of the span.
      Returns:
      the finishMicros
    • setFinishMicros

      public void setFinishMicros(long newFinishMicros)
      Set the finish time of the span.
      Parameters:
      newFinishMicros - the finishMicros to set
    • getTraceId

      public long getTraceId()
      Get the trace ID of the span.
      Returns:
      the traceId
    • setTraceId

      public void setTraceId(long newTraceId)
      Set the trace ID of the span.
      Parameters:
      newTraceId - the traceId to set
    • getParentId

      public long getParentId()
      Get the Parent ID of the span.
      Returns:
      the parentId
    • setParentId

      public void setParentId(long newParentId)
      Set the parent ID of the span.
      Parameters:
      newParentId - the parentId to set
    • getSpanId

      public long getSpanId()
      Get the Span ID.
      Returns:
      the spanId
    • setSpanId

      public void setSpanId(long newSpanId)
      Set the span ID.
      Parameters:
      newSpanId - the spanId to set
    • getCachedOperationName

      public String getCachedOperationName()
      Get the operation name of the span.
      Returns:
      the operationName
    • setCachedOperationName

      public void setCachedOperationName(String newCachedOperationName)
      Set the operation name of the span.
      Parameters:
      newCachedOperationName - the operationName to set
    • getTags

      public Map<String,Object> getTags()
      Return a map of tags.
      Returns:
      the tags
    • setTags

      public void setTags(Map<String,Object> newTags)
      Set the map of tags.
      Parameters:
      newTags - the tags to set
    • getLogEntries

      public List<Map<String,?>> getLogEntries()
      Return a list of log entries.
      Returns:
      the log entries
    • setLogEntries

      public void setLogEntries(List<Map<String,?>> newLogEntries)
      Set the list of log entries
      Parameters:
      newLogEntries - the log entries to set
    • context

      public io.opentracing.SpanContext context()
      Specified by:
      context in interface io.opentracing.Span
    • setTag

      public io.opentracing.Span setTag(String key, String value)
      Specified by:
      setTag in interface io.opentracing.Span
    • setTag

      public io.opentracing.Span setTag(String key, boolean value)
      Specified by:
      setTag in interface io.opentracing.Span
    • setTag

      public io.opentracing.Span setTag(String key, Number value)
      Specified by:
      setTag in interface io.opentracing.Span
    • setTag

      public <T> io.opentracing.Span setTag(io.opentracing.tag.Tag<T> tag, T value)
      Specified by:
      setTag in interface io.opentracing.Span
    • log

      public io.opentracing.Span log(Map<String,?> fields)
      Specified by:
      log in interface io.opentracing.Span
    • log

      public io.opentracing.Span log(long timestampMicroseconds, Map<String,?> fields)
      Specified by:
      log in interface io.opentracing.Span
    • log

      public io.opentracing.Span log(String event)
      Specified by:
      log in interface io.opentracing.Span
    • log

      public io.opentracing.Span log(long timestampMicroseconds, String event)
      Specified by:
      log in interface io.opentracing.Span
    • setBaggageItem

      public io.opentracing.Span setBaggageItem(String key, String value)
      Specified by:
      setBaggageItem in interface io.opentracing.Span
    • getBaggageItem

      public String getBaggageItem(String key)
      Specified by:
      getBaggageItem in interface io.opentracing.Span
    • setOperationName

      public io.opentracing.Span setOperationName(String operationName)
      Specified by:
      setOperationName in interface io.opentracing.Span
    • finish

      public void finish()
      Specified by:
      finish in interface io.opentracing.Span
    • finish

      public void finish(long newFinishMicros)
      Specified by:
      finish in interface io.opentracing.Span
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object