Class ThreadStatesGaugeSet

  • All Implemented Interfaces:
    Metric, MetricSet

    public class ThreadStatesGaugeSet
    extends java.lang.Object
    implements MetricSet
    A set of gauges for the number of threads in their various states and deadlock detection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​Metric> getMetrics()
      A map of metric names to metrics.
      private int getThreadCount​(java.lang.Thread.State state)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • threads

        private final java.lang.management.ThreadMXBean threads
    • Constructor Detail

      • ThreadStatesGaugeSet

        public ThreadStatesGaugeSet()
        Creates a new set of gauges using the default MXBeans.
      • ThreadStatesGaugeSet

        public ThreadStatesGaugeSet​(java.lang.management.ThreadMXBean threads,
                                    ThreadDeadlockDetector deadlockDetector)
        Creates a new set of gauges using the given MXBean and detector.
        Parameters:
        threads - a thread MXBean
        deadlockDetector - a deadlock detector
    • Method Detail

      • getMetrics

        public java.util.Map<java.lang.String,​Metric> getMetrics()
        Description copied from interface: MetricSet
        A map of metric names to metrics.
        Specified by:
        getMetrics in interface MetricSet
        Returns:
        the metrics
      • getThreadCount

        private int getThreadCount​(java.lang.Thread.State state)