public static void registerMBean ( final ObjectInstance objectInstance , final String mBeanAttributeName , MetricName metricName , Metric2Registry metricRegistry ) { metricRegistry . register ( metricName , new Gauge < Object > ( ) { @ Override public Object getValue ( ) { return getValueFromMBean ( objectInstance , mBeanAttributeName ) ; } } ) ; }
Registers a MBean into the MetricRegistry