Class MetricRegistryImpl

    • Constructor Detail

      • MetricRegistryImpl

        public MetricRegistryImpl​(String regName,
                                  Function<String,​Long> hitRateCfgProvider,
                                  Function<String,​long[]> histogramCfgProvider,
                                  IgniteLogger log)
        Parameters:
        regName - Registry name.
        hitRateCfgProvider - HitRate config provider.
        histogramCfgProvider - Histogram config provider.
        log - Logger.
    • Method Detail

      • findMetric

        @Nullable
        public <M extends Metric> M findMetric​(String name)
        Specified by:
        findMetric in interface ReadOnlyMetricRegistry
        Type Parameters:
        M - Type of the metric.
        Parameters:
        name - Name of the metric.
        Returns:
        Metric with specified name if exists. Null otherwise.
      • reset

        public void reset()
        Resets state of this metric registry.
      • objectMetric

        public <T> ObjectMetricImpl<T> objectMetric​(String name,
                                                    Class<T> type,
                                                    @Nullable
                                                    @Nullable String desc)
        Creates and register named gauge. Returned instance are thread safe.
        Parameters:
        name - Name.
        type - Type.
        desc - Description.
        Returns:
        ObjectMetricImpl
      • register

        public void register​(Metric metric)
        Register existing metrics in this group with the specified name. Note that the name of the metric must start with the name of the current registry it is registered into.
        Parameters:
        metric - Metric.
      • remove

        public void remove​(String name)
        Removes metrics with the name.
        Specified by:
        remove in interface MetricRegistry
        Parameters:
        name - Metric short name. Doesn't include registry name.
      • register

        public void register​(String name,
                             BooleanSupplier supplier,
                             @Nullable
                             @Nullable String desc)
        Registers a boolean metric which value will be queried from the specified supplier.
        Specified by:
        register in interface MetricRegistry
        Parameters:
        name - Metric short name. Doesn't include registry name.
        supplier - Metric value supplier.
        desc - Metric description.
      • register

        public void register​(String name,
                             DoubleSupplier supplier,
                             @Nullable
                             @Nullable String desc)
        Registers a double metric which value will be queried from the specified supplier.
        Specified by:
        register in interface MetricRegistry
        Parameters:
        name - Metric short name. Doesn't include the registry name.
        supplier - Metric value supplier.
        desc - Metric description.
      • register

        public void register​(String name,
                             IntSupplier supplier,
                             @Nullable
                             @Nullable String desc)
        Registers an int metric which value will be queried from the specified supplier.
        Specified by:
        register in interface MetricRegistry
        Parameters:
        name - Metric short name. Doesn't include registry name.
        supplier - Metric value supplier.
        desc - Metric description.
      • register

        public void register​(String name,
                             LongSupplier supplier,
                             @Nullable
                             @Nullable String desc)
        Registers a long metric which value will be queried from the specified supplier.
        Specified by:
        register in interface MetricRegistry
        Parameters:
        name - Metric short name. Doesn't include registry name.
        supplier - Metric value supplier.
        desc - Metric description.
      • register

        public <T> void register​(String name,
                                 Supplier<T> supplier,
                                 Class<T> type,
                                 @Nullable
                                 @Nullable String desc)
        Registers an object metric which value will be queried from the specified supplier.
        Specified by:
        register in interface MetricRegistry
        Type Parameters:
        T - Metric value type.
        Parameters:
        name - Metric short name. Doesn't include registry name.
        supplier - Metric value supplier.
        type - Metric value type.
        desc - Metric description.
      • doubleMetric

        public DoubleMetricImpl doubleMetric​(String name,
                                             @Nullable
                                             @Nullable String desc)
        Creates and register named metric. Returned instance are thread safe.
        Parameters:
        name - Name.
        desc - Description.
        Returns:
        DoubleMetricImpl.
      • intMetric

        public IntMetricImpl intMetric​(String name,
                                       @Nullable
                                       @Nullable String desc)
        Creates and register named metric. Returned instance are thread safe.
        Parameters:
        name - Name.
        desc - Description.
        Returns:
        IntMetricImpl.
      • longMetric

        public AtomicLongMetric longMetric​(String name,
                                           @Nullable
                                           @Nullable String desc)
        Creates and register named metric. Returned instance are thread safe.
        Parameters:
        name - Name.
        desc - Description.
        Returns:
        AtomicLongMetric.
      • longAdderMetric

        public LongAdderMetric longAdderMetric​(String name,
                                               @Nullable
                                               @Nullable String desc)
        Creates and register named metric. Returned instance are thread safe.
        Parameters:
        name - Name.
        desc - Description.
        Returns:
        LongAdderMetric.
      • hitRateMetric

        public HitRateMetric hitRateMetric​(String name,
                                           @Nullable
                                           @Nullable String desc,
                                           long rateTimeInterval,
                                           int size)
        Creates and register hit rate metric. It will accumulates approximate hit rate statistics. Calculates number of hits in last rateTimeInterval milliseconds.
        Parameters:
        rateTimeInterval - Rate time interval.
        size - Array size for underlying calculations.
        Returns:
        HitRateMetric
        See Also:
        HitRateMetric
      • booleanMetric

        public BooleanMetricImpl booleanMetric​(String name,
                                               @Nullable
                                               @Nullable String desc)
        Creates and register named gauge. Returned instance are thread safe.
        Parameters:
        name - Name.
        desc - Description.
        Returns:
        BooleanMetricImpl
      • histogram

        public HistogramMetricImpl histogram​(String name,
                                             long[] bounds,
                                             @Nullable
                                             @Nullable String desc)
        Creates and registre named histogram gauge.
        Parameters:
        name - Name
        bounds - Bounds of measurements.
        desc - Description.
        Returns:
        HistogramMetricImpl