Class SampledSpanStoreImpl.NoopSampledSpanStoreImpl

    • Field Detail

      • 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
    • Constructor Detail

      • NoopSampledSpanStoreImpl

        private NoopSampledSpanStoreImpl()
    • Method Detail

      • considerForSampling

        public void considerForSampling​(RecordEventsSpanImpl span)
        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 class SampledSpanStoreImpl
        Parameters:
        span - the span to be consider for storing into the store buckets.
      • getEnabled

        public boolean getEnabled()
        Description copied from class: SampledSpanStoreImpl
        Returns true if the SampledSpanStore is enabled.
        Specified by:
        getEnabled in class SampledSpanStoreImpl
        Returns:
        true if the SampledSpanStore is enabled.
      • registerSpanNamesForCollection

        public void registerSpanNamesForCollection​(java.util.Collection<java.lang.String> spanNames)
        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 class SampledSpanStore
        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: 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 class SampledSpanStore
        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: 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 class SampledSpanStore
        Returns:
        the set of unique span names registered to the library.