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
Fields Modifier and Type Field Description private static java.util.Set<java.lang.String>EMPTY_REGISTERED_SPAN_NAMESprivate static java.util.Collection<SpanData>EMPTY_SPANDATAprivate static SampledSpanStore.SummaryEMPTY_SUMMARY
-
Constructor Summary
Constructors Modifier Constructor Description privateNoopSampledSpanStoreImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsiderForSampling(RecordEventsSpanImpl span)Considers to save the given spans to the stored samples.booleangetEnabled()Returnstrueif the SampledSpanStore is enabled.java.util.Collection<SpanData>getErrorSampledSpans(SampledSpanStore.ErrorFilter filter)java.util.Collection<SpanData>getLatencySampledSpans(SampledSpanStore.LatencyFilter filter)java.util.Set<java.lang.String>getRegisteredSpanNamesForCollection()Returns the set of unique span names registered to the library, for use in tests.SampledSpanStore.SummarygetSummary()Returns the summary of all available data, such as number of sampled spans in the latency based samples or error based samples.voidregisterSpanNamesForCollection(java.util.Collection<java.lang.String> spanNames)Appends a list of span names for which the library will collect latency based sampled spans and error based sampled spans.voidunregisterSpanNamesForCollection(java.util.Collection<java.lang.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 Detail
-
EMPTY_SUMMARY
private static final SampledSpanStore.Summary EMPTY_SUMMARY
-
EMPTY_REGISTERED_SPAN_NAMES
private static final java.util.Set<java.lang.String> EMPTY_REGISTERED_SPAN_NAMES
-
EMPTY_SPANDATA
private static final java.util.Collection<SpanData> EMPTY_SPANDATA
-
-
Method Detail
-
getSummary
public SampledSpanStore.Summary 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
public void considerForSampling(RecordEventsSpanImpl span)
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
public void registerSpanNamesForCollection(java.util.Collection<java.lang.String> spanNames)
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.
-
unregisterSpanNamesForCollection
public void unregisterSpanNamesForCollection(java.util.Collection<java.lang.String> spanNames)
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.
-
getRegisteredSpanNamesForCollection
public java.util.Set<java.lang.String> 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
public java.util.Collection<SpanData> getErrorSampledSpans(SampledSpanStore.ErrorFilter filter)
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
public java.util.Collection<SpanData> getLatencySampledSpans(SampledSpanStore.LatencyFilter filter)
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.
-
-