Package io.opencensus.testing.export
Class TestHandler
java.lang.Object
io.opencensus.trace.export.SpanExporter.Handler
io.opencensus.testing.export.TestHandler
A
SpanExporter.Handler
for testing only.- Since:
- 0.9
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
export
(Collection<SpanData> spanDataList) Exports a list of sampled (seeTraceOptions.isSampled()
)Span
s using the immutable representationSpanData
.waitForExport
(int numberOfSpans) Waits until we received numberOfSpans spans to export.
-
Field Details
-
monitor
-
spanDataList
-
-
Constructor Details
-
TestHandler
public TestHandler()
-
-
Method Details
-
export
Description copied from class:SpanExporter.Handler
Exports a list of sampled (seeTraceOptions.isSampled()
)Span
s using the immutable representationSpanData
.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 classSpanExporter.Handler
- Parameters:
spanDataList
- a list ofSpanData
objects to be exported.
-
waitForExport
Waits until we received numberOfSpans spans to export. Returns the list of exportedSpanData
objects, otherwisenull
if the current thread is interrupted.- Parameters:
numberOfSpans
- the number of minimum spans to be collected.- Returns:
- the list of exported
SpanData
objects, otherwisenull
if the current thread is interrupted. - Since:
- 0.9
-