Class SpanExporterImpl
- java.lang.Object
-
- io.opencensus.trace.export.SpanExporter
-
- io.opencensus.implcore.trace.export.SpanExporterImpl
-
public final class SpanExporterImpl extends SpanExporter
Implementation of theSpanExporter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSpanExporterImpl.ReportDroppedSpansprivate static classSpanExporterImpl.ReportPushedSpansprivate static classSpanExporterImpl.ReportReferencedSpansprivate static classSpanExporterImpl.Worker-
Nested classes/interfaces inherited from class io.opencensus.trace.export.SpanExporter
SpanExporter.Handler
-
-
Field Summary
Fields Modifier and Type Field Description private static DerivedLongCumulativedroppedSpansprivate static java.util.logging.Loggerloggerprivate static DerivedLongCumulativepushedSpansprivate static DerivedLongGaugereferencedSpansprivate SpanExporterImpl.Workerworkerprivate java.lang.ThreadworkerThread
-
Constructor Summary
Constructors Modifier Constructor Description privateSpanExporterImpl(SpanExporterImpl.Worker worker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSpan(RecordEventsSpanImpl span)Adds a Span to the exporting service.(package private) static SpanExporterImplcreate(int bufferSize, Duration scheduleDelay)Constructs aSpanExporterImplthat exports theSpanDataasynchronously.(package private) voidflush()(package private) longgetDroppedSpans()(package private) longgetPushedSpans()(package private) longgetReferencedSpans()(package private) java.lang.ThreadgetServiceExporterThread()voidregisterHandler(java.lang.String name, SpanExporter.Handler handler)Registers a new service handler that is used by the library to exportSpanDatafor sampled spans (seeTraceOptions.isSampled()).(package private) voidshutdown()voidunregisterHandler(java.lang.String name)Unregisters the service handler with the provided name.-
Methods inherited from class io.opencensus.trace.export.SpanExporter
getNoopSpanExporter
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
droppedSpans
private static final DerivedLongCumulative droppedSpans
-
pushedSpans
private static final DerivedLongCumulative pushedSpans
-
referencedSpans
private static final DerivedLongGauge referencedSpans
-
worker
private final SpanExporterImpl.Worker worker
-
workerThread
private final java.lang.Thread workerThread
-
-
Constructor Detail
-
SpanExporterImpl
private SpanExporterImpl(SpanExporterImpl.Worker worker)
-
-
Method Detail
-
create
static SpanExporterImpl create(int bufferSize, Duration scheduleDelay)
Constructs aSpanExporterImplthat exports theSpanDataasynchronously.Starts a separate thread that wakes up every
scheduleDelayand exports any available spans data. If the number of buffered SpanData objects is greater thanbufferSizethen the thread wakes up sooner.- Parameters:
bufferSize- the size of the buffered span data.scheduleDelay- the maximum delay.
-
addSpan
public void addSpan(RecordEventsSpanImpl span)
Adds a Span to the exporting service.- Parameters:
span- theSpanto be added.
-
registerHandler
public void registerHandler(java.lang.String name, SpanExporter.Handler handler)Description copied from class:SpanExporterRegisters a new service handler that is used by the library to exportSpanDatafor sampled spans (seeTraceOptions.isSampled()).- Specified by:
registerHandlerin classSpanExporter- Parameters:
name- the name of the service handler. Must be unique for each service.handler- the service handler that is called for each ended sampled span.
-
unregisterHandler
public void unregisterHandler(java.lang.String name)
Description copied from class:SpanExporterUnregisters the service handler with the provided name.- Specified by:
unregisterHandlerin classSpanExporter- Parameters:
name- the name of the service handler that will be unregistered.
-
flush
void flush()
-
shutdown
void shutdown()
-
getServiceExporterThread
java.lang.Thread getServiceExporterThread()
-
getDroppedSpans
long getDroppedSpans()
-
getReferencedSpans
long getReferencedSpans()
-
getPushedSpans
long getPushedSpans()
-
-