Class InProcessSampledSpanStoreImpl
java.lang.Object
io.opencensus.trace.export.SampledSpanStore
io.opencensus.implcore.trace.export.SampledSpanStoreImpl
io.opencensus.implcore.trace.export.InProcessSampledSpanStoreImpl
In-process implementation of the
SampledSpanStore.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final classKeeps samples for a given span name.private static final classprivate static final classNested classes/interfaces inherited from class SampledSpanStore
SampledSpanStore.ErrorFilter, SampledSpanStore.LatencyBucketBoundaries, SampledSpanStore.LatencyFilter, SampledSpanStore.PerSpanNameSummary, SampledSpanStore.Summary -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EventQueueprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate final Map<String, InProcessSampledSpanStoreImpl.PerSpanNameSamples> private static final long -
Constructor Summary
ConstructorsConstructorDescriptionInProcessSampledSpanStoreImpl(EventQueue eventQueue) Constructs a newInProcessSampledSpanStoreImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoidConsiders to save the given spans to the stored samples.booleanReturnstrueif the SampledSpanStore is enabled.Returns the set of unique span names registered to the library, for use in tests.Returns the summary of all available data, such as number of sampled spans in the latency based samples or error based samples.private voidinternaltRegisterSpanNamesForCollection(Collection<String> spanNames) private voidinternalUnregisterSpanNamesForCollection(Collection<String> spanNames) voidregisterSpanNamesForCollection(Collection<String> spanNames) Appends a list of span names for which the library will collect latency based sampled spans and error based sampled spans.protected voidshutdown()voidunregisterSpanNamesForCollection(Collection<String> spanNames) Removes a list of span names for which the library will collect latency based sampled spans and error based sampled spans.Methods inherited from class SampledSpanStoreImpl
getNoopSampledSpanStoreImpl
-
Field Details
-
NUM_SAMPLES_PER_LATENCY_BUCKET
private static final int NUM_SAMPLES_PER_LATENCY_BUCKET- See Also:
-
NUM_SAMPLES_PER_ERROR_BUCKET
private static final int NUM_SAMPLES_PER_ERROR_BUCKET- See Also:
-
TIME_BETWEEN_SAMPLES
private static final long TIME_BETWEEN_SAMPLES -
NUM_LATENCY_BUCKETS
private static final int NUM_LATENCY_BUCKETS -
NUM_ERROR_BUCKETS
private static final int NUM_ERROR_BUCKETS -
MAX_PER_SPAN_NAME_SAMPLES
private static final int MAX_PER_SPAN_NAME_SAMPLES -
eventQueue
-
samples
-
-
Constructor Details
-
InProcessSampledSpanStoreImpl
InProcessSampledSpanStoreImpl(EventQueue eventQueue) Constructs a newInProcessSampledSpanStoreImpl.
-
-
Method Details
-
getSummary
Description copied from class:SampledSpanStoreReturns the summary of all available data, such as number of sampled spans in the latency based samples or error based samples.Data available only for span names registered using
SampledSpanStore.registerSpanNamesForCollection(Collection).- Specified by:
getSummaryin classSampledSpanStore- Returns:
- the summary of all available data.
-
considerForSampling
Description copied from class:SampledSpanStoreImplConsiders to save the given spans to the stored samples. This must be called at the end of each Span with the option RECORD_EVENTS.- Specified by:
considerForSamplingin classSampledSpanStoreImpl- Parameters:
span- the span to be consider for storing into the store buckets.
-
getEnabled
public boolean getEnabled()Description copied from class:SampledSpanStoreImplReturnstrueif the SampledSpanStore is enabled.- Specified by:
getEnabledin classSampledSpanStoreImpl- Returns:
trueif the SampledSpanStore is enabled.
-
registerSpanNamesForCollection
Description copied from class:SampledSpanStoreAppends a list of span names for which the library will collect latency based sampled spans and error based sampled spans.If called multiple times the library keeps the list of unique span names from all the calls.
- Specified by:
registerSpanNamesForCollectionin classSampledSpanStore- Parameters:
spanNames- list of span names for which the library will collect samples.
-
shutdown
protected void shutdown()- Overrides:
shutdownin classSampledSpanStoreImpl
-
internaltRegisterSpanNamesForCollection
-
unregisterSpanNamesForCollection
Description copied from class:SampledSpanStoreRemoves a list of span names for which the library will collect latency based sampled spans and error based sampled spans.The library keeps the list of unique registered span names for which samples will be called. This method allows users to remove span names from that list.
- Specified by:
unregisterSpanNamesForCollectionin classSampledSpanStore- Parameters:
spanNames- list of span names for which the library will no longer collect samples.
-
internalUnregisterSpanNamesForCollection
-
getRegisteredSpanNamesForCollection
Description copied from class:SampledSpanStoreReturns the set of unique span names registered to the library, for use in tests. For this set of span names the library will collect latency based sampled spans and error based sampled spans.This method is only meant for testing code that uses OpenCensus, and it is not performant.
- Specified by:
getRegisteredSpanNamesForCollectionin classSampledSpanStore- Returns:
- the set of unique span names registered to the library.
-
getErrorSampledSpans
Description copied from class:SampledSpanStoreReturns a list of failed spans (spans withStatusother thanStatus.OK) that match thefilter.Error based sampled spans are available only for span names registered using
SampledSpanStore.registerSpanNamesForCollection(Collection).- Specified by:
getErrorSampledSpansin classSampledSpanStore- Parameters:
filter- used to filter the returned sampled spans.- Returns:
- a list of failed spans that match the
filter.
-
getLatencySampledSpans
Description copied from class:SampledSpanStoreReturns a list of succeeded spans (spans withStatusequal toStatus.OK) that match thefilter.Latency based sampled spans are available only for span names registered using
SampledSpanStore.registerSpanNamesForCollection(Collection).- Specified by:
getLatencySampledSpansin classSampledSpanStore- Parameters:
filter- used to filter the returned sampled spans.- Returns:
- a list of succeeded spans that match the
filter.
-