Class JmxAttributeGauge

java.lang.Object
com.codahale.metrics.JmxAttributeGauge
All Implemented Interfaces:
Gauge<Object>, Metric

public class JmxAttributeGauge extends Object implements Gauge<Object>
A Gauge implementation which queries a MBeanServer for an attribute of an object.
  • Field Details

    • mBeanServer

      private final MBeanServer mBeanServer
    • objectName

      private final ObjectName objectName
    • attributeName

      private final String attributeName
  • Constructor Details

    • JmxAttributeGauge

      public JmxAttributeGauge(ObjectName objectName, String attributeName)
      Creates a new JmxAttributeGauge.
      Parameters:
      objectName - the name of the object
      attributeName - the name of the object's attribute
    • JmxAttributeGauge

      public JmxAttributeGauge(MBeanServer mBeanServer, ObjectName objectName, String attributeName)
      Creates a new JmxAttributeGauge.
      Parameters:
      mBeanServer - the MBeanServer
      objectName - the name of the object
      attributeName - the name of the object's attribute
  • Method Details

    • getValue

      public Object getValue()
      Description copied from interface: Gauge
      Returns the metric's current value.
      Specified by:
      getValue in interface Gauge<Object>
      Returns:
      the metric's current value