Class CachedThreadStatesGaugeSet

  • All Implemented Interfaces:
    Metric, MetricSet

    public class CachedThreadStatesGaugeSet
    extends ThreadStatesGaugeSet
    A variation of ThreadStatesGaugeSet that caches the ThreadInfo[] objects for a given interval.
    • Constructor Detail

      • CachedThreadStatesGaugeSet

        public CachedThreadStatesGaugeSet​(ThreadMXBean threadMXBean,
                                          ThreadDeadlockDetector deadlockDetector,
                                          long interval,
                                          TimeUnit unit)
        Creates a new set of gauges using the given MXBean and detector. Caches the information for the given interval and time unit.
        Parameters:
        threadMXBean - a thread MXBean
        deadlockDetector - a deadlock detector
        interval - cache interval
        unit - cache interval time unit
      • CachedThreadStatesGaugeSet

        public CachedThreadStatesGaugeSet​(long interval,
                                          TimeUnit unit)
        Creates a new set of gauges using the default MXBeans. Caches the information for the given interval and time unit.
        Parameters:
        interval - cache interval
        unit - cache interval time unit