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 TypeMethodDescriptionvoidexport(Collection<SpanData> spanDataList) Exports a list of sampled (seeTraceOptions.isSampled())Spans 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.HandlerExports a list of sampled (seeTraceOptions.isSampled())Spans 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:
exportin classSpanExporter.Handler- Parameters:
spanDataList- a list ofSpanDataobjects to be exported.
-
waitForExport
Waits until we received numberOfSpans spans to export. Returns the list of exportedSpanDataobjects, otherwisenullif the current thread is interrupted.- Parameters:
numberOfSpans- the number of minimum spans to be collected.- Returns:
- the list of exported
SpanDataobjects, otherwisenullif the current thread is interrupted. - Since:
- 0.9
-