Class MonitorRegistries

    • Method Detail

      • getMetricRegistry

        public static com.codahale.metrics.MetricRegistry getMetricRegistry()
        Returns the singleton shared registry for metric instances.
        Returns:
        The registry.
      • getHealthCheckRegistry

        public static com.codahale.metrics.health.HealthCheckRegistry getHealthCheckRegistry()
        Returns the singleton shared registry for health check instances.
        Returns:
        The registry.
      • register

        public static void register​(com.codahale.metrics.MetricSet metricSet)
        Registers a metric set.
        Parameters:
        metricSet - The metric set to register. If null the method will return immediately.
      • register

        public static void register​(String name,
                                    com.codahale.metrics.Metric metric)
        Registers, updates or unregisters a metric.
        Parameters:
        name - The metric name. If null the method will return immediately.
        metric - The metric, null to unregister. If a metric with the same name exists it will be replaced.
      • registerEntryCountGauge

        public static void registerEntryCountGauge​(String name,
                                                   Supplier<Integer> supplier)
        Registers or updates an entry count gauge according to the configured cache timeout.
        Parameters:
        name - The gauge name name. If null the method will return immediately.
        supplier - The entry count supplier.
      • getEntryCountCacheTimeout

        public static long getEntryCountCacheTimeout()
        Gets the timeout for entry count gauges.
        Returns:
        The timeout for caching entry count results, in seconds. Zero means no caching, negative disabled readings.
      • setEntryCountCacheTimeout

        public static void setEntryCountCacheTimeout​(long entryCountCacheTimeout)
        Sets the timeout for entry count gauges.
        Parameters:
        entryCountCacheTimeout - The timeout for caching entry count results, in seconds. Zero means no caching, negative disabled readings.
      • register

        public static void register​(String name,
                                    com.codahale.metrics.health.HealthCheck check)
        Registers, updates or unregisters a health check.
        Parameters:
        name - The health check name. If null the method will return immediately.
        check - The health check, null to unregister. If a metric with the same name exists it will be replaced.