Class MetricRegistry

    • Constructor Detail

      • MetricRegistry

        public MetricRegistry()
    • Method Detail

      • addLongGauge

        @Deprecated
        public LongGauge addLongGauge​(java.lang.String name,
                                      java.lang.String description,
                                      java.lang.String unit,
                                      java.util.List<LabelKey> labelKeys)
        Deprecated.
        This will be removed in 0.22.
        Since:
        0.17
      • addLongGauge

        @ExperimentalApi
        public abstract LongGauge addLongGauge​(java.lang.String name,
                                               MetricOptions options)
        Builds a new long gauge to be added to the registry. This is a more convenient form when you want to manually increase and decrease values as per your service requirements.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a LongGauge.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.20
      • addDoubleGauge

        @Deprecated
        public DoubleGauge addDoubleGauge​(java.lang.String name,
                                          java.lang.String description,
                                          java.lang.String unit,
                                          java.util.List<LabelKey> labelKeys)
        Deprecated.
        This will be removed in 0.22.
        Since:
        0.17
      • addDoubleGauge

        @ExperimentalApi
        public abstract DoubleGauge addDoubleGauge​(java.lang.String name,
                                                   MetricOptions options)
        Builds a new double gauge to be added to the registry. This is a more convenient form when you want to manually increase and decrease values as per your service requirements.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a DoubleGauge.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.20
      • addDerivedLongGauge

        @ExperimentalApi
        public abstract DerivedLongGauge addDerivedLongGauge​(java.lang.String name,
                                                             MetricOptions options)
        Builds a new derived long gauge to be added to the registry. This is a more convenient form when you want to define a gauge by executing a ToLongFunction on an object.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a DerivedLongGauge.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.17
      • addDerivedDoubleGauge

        @ExperimentalApi
        public abstract DerivedDoubleGauge addDerivedDoubleGauge​(java.lang.String name,
                                                                 MetricOptions options)
        Builds a new derived double gauge to be added to the registry. This is a more convenient form when you want to define a gauge by executing a ToDoubleFunction on an object.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a DerivedDoubleGauge.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.17
      • addLongCumulative

        @ExperimentalApi
        public abstract LongCumulative addLongCumulative​(java.lang.String name,
                                                         MetricOptions options)
        Builds a new long cumulative to be added to the registry. This is a more convenient form when you want to manually increase values as per your service requirements.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a LongCumulative.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.21
      • addDoubleCumulative

        @ExperimentalApi
        public abstract DoubleCumulative addDoubleCumulative​(java.lang.String name,
                                                             MetricOptions options)
        Builds a new double cumulative to be added to the registry. This is a more convenient form when you want to manually increase values as per your service requirements.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a DoubleCumulative.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.21
      • addDerivedLongCumulative

        @ExperimentalApi
        public abstract DerivedLongCumulative addDerivedLongCumulative​(java.lang.String name,
                                                                       MetricOptions options)
        Builds a new derived long cumulative to be added to the registry. This is a more convenient form when you want to define a cumulative by executing a ToLongFunction on an object.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a DerivedLongCumulative.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.21
      • addDerivedDoubleCumulative

        @ExperimentalApi
        public abstract DerivedDoubleCumulative addDerivedDoubleCumulative​(java.lang.String name,
                                                                           MetricOptions options)
        Builds a new derived double cumulative to be added to the registry. This is a more convenient form when you want to define a cumulative by executing a ToDoubleFunction on an object.
        Parameters:
        name - the name of the metric.
        options - the options for the metric.
        Returns:
        a DerivedDoubleCumulative.
        Throws:
        java.lang.NullPointerException - if name is null.
        java.lang.IllegalArgumentException - if different metric with the same name already registered.
        Since:
        0.21
      • newNoopMetricRegistry

        static MetricRegistry newNoopMetricRegistry()