Class GarbageCollectorMetricSet

  • All Implemented Interfaces:
    Metric, MetricSet

    public class GarbageCollectorMetricSet
    extends java.lang.Object
    implements MetricSet
    A set of gauges for the counts and elapsed times of garbage collections.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.management.GarbageCollectorMXBean> garbageCollectors  
      private static java.util.regex.Pattern WHITESPACE  
    • Constructor Summary

      Constructors 
      Constructor Description
      GarbageCollectorMetricSet()
      Creates a new set of gauges for all discoverable garbage collectors.
      GarbageCollectorMetricSet​(java.util.Collection<java.lang.management.GarbageCollectorMXBean> garbageCollectors)
      Creates a new set of gauges for the given collection of garbage collectors.
    • 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.
      • Methods inherited from class java.lang.Object

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

      • WHITESPACE

        private static final java.util.regex.Pattern WHITESPACE
      • garbageCollectors

        private final java.util.List<java.lang.management.GarbageCollectorMXBean> garbageCollectors
    • Constructor Detail

      • GarbageCollectorMetricSet

        public GarbageCollectorMetricSet()
        Creates a new set of gauges for all discoverable garbage collectors.
      • GarbageCollectorMetricSet

        public GarbageCollectorMetricSet​(java.util.Collection<java.lang.management.GarbageCollectorMXBean> garbageCollectors)
        Creates a new set of gauges for the given collection of garbage collectors.
        Parameters:
        garbageCollectors - the garbage collectors
    • 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