Class StatsTestUtils.MockableSpan

java.lang.Object
io.opencensus.trace.Span
io.grpc.internal.testing.StatsTestUtils.MockableSpan
Enclosing class:
StatsTestUtils

public static class StatsTestUtils.MockableSpan extends io.opencensus.trace.Span
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Mockable implementation for the SpanBuilder class.

    Nested classes/interfaces inherited from class io.opencensus.trace.Span

    io.opencensus.trace.Span.Kind, io.opencensus.trace.Span.Options
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    MockableSpan(io.opencensus.trace.SpanContext context, EnumSet<io.opencensus.trace.Span.Options> options)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAnnotation(io.opencensus.trace.Annotation annotation)
     
    void
    addAnnotation(String description, Map<String,io.opencensus.trace.AttributeValue> attributes)
     
    void
    addLink(io.opencensus.trace.Link link)
     
    void
    addMessageEvent(io.opencensus.trace.MessageEvent messageEvent)
     
    void
    end(io.opencensus.trace.EndSpanOptions options)
     
    Creates a MockableSpan with a random trace ID and span ID.
    void
    putAttributes(Map<String,io.opencensus.trace.AttributeValue> attributes)
     

    Methods inherited from class io.opencensus.trace.Span

    addAnnotation, addAttributes, addNetworkEvent, end, getContext, getOptions, putAttribute, setStatus

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockableSpan

      private MockableSpan(io.opencensus.trace.SpanContext context, @Nullable EnumSet<io.opencensus.trace.Span.Options> options)
  • Method Details

    • generateRandomSpan

      public static StatsTestUtils.MockableSpan generateRandomSpan(Random random)
      Creates a MockableSpan with a random trace ID and span ID.
    • putAttributes

      public void putAttributes(Map<String,io.opencensus.trace.AttributeValue> attributes)
      Overrides:
      putAttributes in class io.opencensus.trace.Span
    • addAnnotation

      public void addAnnotation(String description, Map<String,io.opencensus.trace.AttributeValue> attributes)
      Specified by:
      addAnnotation in class io.opencensus.trace.Span
    • addAnnotation

      public void addAnnotation(io.opencensus.trace.Annotation annotation)
      Specified by:
      addAnnotation in class io.opencensus.trace.Span
    • addMessageEvent

      public void addMessageEvent(io.opencensus.trace.MessageEvent messageEvent)
      Overrides:
      addMessageEvent in class io.opencensus.trace.Span
    • addLink

      public void addLink(io.opencensus.trace.Link link)
      Specified by:
      addLink in class io.opencensus.trace.Span
    • end

      public void end(io.opencensus.trace.EndSpanOptions options)
      Specified by:
      end in class io.opencensus.trace.Span