Class InProcessSampledSpanStoreImpl

    • Field Detail

      • NUM_SAMPLES_PER_LATENCY_BUCKET

        private static final int NUM_SAMPLES_PER_LATENCY_BUCKET
        See Also:
        Constant Field Values
      • NUM_SAMPLES_PER_ERROR_BUCKET

        private static final int NUM_SAMPLES_PER_ERROR_BUCKET
        See Also:
        Constant Field Values
      • 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
    • Constructor Detail

      • InProcessSampledSpanStoreImpl

        InProcessSampledSpanStoreImpl​(EventQueue eventQueue)
        Constructs a new InProcessSampledSpanStoreImpl.
    • 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.
      • internaltRegisterSpanNamesForCollection

        private void internaltRegisterSpanNamesForCollection​(java.util.Collection<java.lang.String> spanNames)
      • 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.
      • internalUnregisterSpanNamesForCollection

        private void internalUnregisterSpanNamesForCollection​(java.util.Collection<java.lang.String> spanNames)
      • 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.