Class SampledSpanStoreImpl.NoopSampledSpanStoreImpl
java.lang.Object
io.opencensus.trace.export.SampledSpanStore
io.opencensus.implcore.trace.export.SampledSpanStoreImpl
io.opencensus.implcore.trace.export.SampledSpanStoreImpl.NoopSampledSpanStoreImpl
- Enclosing class:
SampledSpanStoreImpl
private static final class SampledSpanStoreImpl.NoopSampledSpanStoreImpl
extends SampledSpanStoreImpl
-
Nested Class Summary
Nested classes/interfaces inherited from class io.opencensus.trace.export.SampledSpanStore
SampledSpanStore.ErrorFilter, SampledSpanStore.LatencyBucketBoundaries, SampledSpanStore.LatencyFilter, SampledSpanStore.PerSpanNameSummary, SampledSpanStore.Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Collection
<SpanData> private static final SampledSpanStore.Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Considers to save the given spans to the stored samples.boolean
Returnstrue
if 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.void
registerSpanNamesForCollection
(Collection<String> spanNames) Appends a list of span names for which the library will collect latency based sampled spans and error based sampled spans.void
unregisterSpanNamesForCollection
(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 io.opencensus.implcore.trace.export.SampledSpanStoreImpl
getNoopSampledSpanStoreImpl, shutdown
-
Field Details
-
EMPTY_SUMMARY
-
EMPTY_REGISTERED_SPAN_NAMES
-
EMPTY_SPANDATA
-
-
Constructor Details
-
NoopSampledSpanStoreImpl
private NoopSampledSpanStoreImpl()
-
-
Method Details
-
getSummary
Description copied from class:SampledSpanStore
Returns 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:
getSummary
in classSampledSpanStore
- Returns:
- the summary of all available data.
-
considerForSampling
Description copied from class:SampledSpanStoreImpl
Considers 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:
considerForSampling
in classSampledSpanStoreImpl
- Parameters:
span
- the span to be consider for storing into the store buckets.
-
getEnabled
public boolean getEnabled()Description copied from class:SampledSpanStoreImpl
Returnstrue
if the SampledSpanStore is enabled.- Specified by:
getEnabled
in classSampledSpanStoreImpl
- Returns:
true
if the SampledSpanStore is enabled.
-
registerSpanNamesForCollection
Description copied from class:SampledSpanStore
Appends 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:
registerSpanNamesForCollection
in classSampledSpanStore
- Parameters:
spanNames
- list of span names for which the library will collect samples.
-
unregisterSpanNamesForCollection
Description copied from class:SampledSpanStore
Removes 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:
unregisterSpanNamesForCollection
in classSampledSpanStore
- Parameters:
spanNames
- list of span names for which the library will no longer collect samples.
-
getRegisteredSpanNamesForCollection
Description copied from class:SampledSpanStore
Returns 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:
getRegisteredSpanNamesForCollection
in classSampledSpanStore
- Returns:
- the set of unique span names registered to the library.
-
getErrorSampledSpans
Description copied from class:SampledSpanStore
Returns a list of failed spans (spans withStatus
other thanStatus.OK
) that match thefilter
.Error based sampled spans are available only for span names registered using
SampledSpanStore.registerSpanNamesForCollection(Collection)
.- Specified by:
getErrorSampledSpans
in 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:SampledSpanStore
Returns a list of succeeded spans (spans withStatus
equal toStatus.OK
) that match thefilter
.Latency based sampled spans are available only for span names registered using
SampledSpanStore.registerSpanNamesForCollection(Collection)
.- Specified by:
getLatencySampledSpans
in classSampledSpanStore
- Parameters:
filter
- used to filter the returned sampled spans.- Returns:
- a list of succeeded spans that match the
filter
.
-