Class TestHandler

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object monitor  
      private java.util.List<SpanData> spanDataList  
    • Constructor Summary

      Constructors 
      Constructor Description
      TestHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void export​(java.util.Collection<SpanData> spanDataList)
      Exports a list of sampled (see TraceOptions.isSampled()) Spans using the immutable representation SpanData.
      java.util.List<SpanData> waitForExport​(int numberOfSpans)
      Waits until we received numberOfSpans spans to export.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • monitor

        private final java.lang.Object monitor
      • spanDataList

        private final java.util.List<SpanData> spanDataList
    • Constructor Detail

      • TestHandler

        public TestHandler()
    • Method Detail

      • export

        public void export​(java.util.Collection<SpanData> spanDataList)
        Description copied from class: SpanExporter.Handler
        Exports a list of sampled (see TraceOptions.isSampled()) Spans using the immutable representation SpanData.

        This may be called from a different thread than the one that called Span.end().

        Implementation SHOULD not block the calling thread. It should execute the export on a different thread if possible.

        Specified by:
        export in class SpanExporter.Handler
        Parameters:
        spanDataList - a list of SpanData objects to be exported.
      • waitForExport

        @Nullable
        public java.util.List<SpanData> waitForExport​(int numberOfSpans)
        Waits until we received numberOfSpans spans to export. Returns the list of exported SpanData objects, otherwise null if the current thread is interrupted.
        Parameters:
        numberOfSpans - the number of minimum spans to be collected.
        Returns:
        the list of exported SpanData objects, otherwise null if the current thread is interrupted.
        Since:
        0.9