Class 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  StatsTestUtils.MockableSpan.Builder
      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, java.util.EnumSet<io.opencensus.trace.Span.Options> options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAnnotation​(io.opencensus.trace.Annotation annotation)  
      void addAnnotation​(java.lang.String description, java.util.Map<java.lang.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)  
      static StatsTestUtils.MockableSpan generateRandomSpan​(java.util.Random random)
      Creates a MockableSpan with a random trace ID and span ID.
      void putAttributes​(java.util.Map<java.lang.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 Detail

      • MockableSpan

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

      • generateRandomSpan

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

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

        public void addAnnotation​(java.lang.String description,
                                  java.util.Map<java.lang.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