Interface MetricFactory


  • public interface MetricFactory
    MetricFactory interface to create metrics for an instrumented entity.
    • Field Detail

      • NONE

        static final MetricFactory NONE
        Empty no-op MetricFactory.
    • Method Detail

      • createCounter

        Counter createCounter​(Descriptor descriptor)
        Create a Counter metric.
        Parameters:
        descriptor - metric descriptor for this Counter
        Returns:
        new Counter for instrumented entity and given descriptor
      • createGaugeLong

        GaugeLong createGaugeLong​(Descriptor descriptor)
        Create a GaugeLong metric.
        Parameters:
        descriptor - metric descriptor for this GaugeLong
        Returns:
        new GaugeLong for instrumented entity and given descriptor
      • createGaugeDouble

        GaugeDouble createGaugeDouble​(Descriptor descriptor)
        Create a GaugeDouble metric.
        Parameters:
        descriptor - metric descriptor for this GaugeDouble
        Returns:
        new GaugeDouble for instrumented entity and given descriptor
      • createProvidingGaugeLong

        ProvidingGaugeLong createProvidingGaugeLong​(Descriptor descriptor,
                                                    LongValueProvider longValueProvider)
        Create a ProvidingGaugeLong metric.
        Parameters:
        descriptor - metric descriptor for this ProvidingGaugeLong
        longValueProvider - LongValueProvider that will be called to get the current value
        Returns:
        new ProvidingGaugeLong for instrumented entity and given descriptor and value provider
      • createProvidingGaugeDouble

        ProvidingGaugeDouble createProvidingGaugeDouble​(Descriptor descriptor,
                                                        DoubleValueProvider doubleValueProvider)
        Create a ProvidingGaugeDouble metric.
        Parameters:
        descriptor - metric descriptor for this ProvidingGaugeDouble
        doubleValueProvider - DoubleValueProvider that will be called to get the current value
        Returns:
        new ProvidingGaugeDouble for instrumented entity and given descriptor and value provider
      • createRate

        Rate createRate​(Descriptor descriptor)
        Create a Rate metric.
        Parameters:
        descriptor - metric descriptor for this Rate
        Returns:
        new Rate for instrumented entity and given descriptor
      • createRecorder

        Recorder createRecorder​(Descriptor descriptor)
        Create a Recorder metric.
        Parameters:
        descriptor - metric descriptor for this Recorder
        Returns:
        new Recorder for instrumented entity and given descriptor