public abstract class AbstractMRulesMetrics extends Object implements io.micrometer.core.instrument.binder.MeterBinder, AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected List<Runnable> |
closeHooks |
protected double |
convertionRatio |
static String |
JMX_DOMAIN
JMX prefix for MRules
|
protected MBeanServer |
mBeanServer |
static String |
METRIC_NAME_PREFIX
Metrics prefix for MRules
|
Constructor and Description |
---|
AbstractMRulesMetrics()
Constructor
|
AbstractMRulesMetrics(MBeanServer mBeanServer)
Constructor
|
AbstractMRulesMetrics(MBeanServer mBeanServer,
TimeUnit timeUnit)
Constructor
|
AbstractMRulesMetrics(TimeUnit timeUnit)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
bindTo(io.micrometer.core.instrument.MeterRegistry registry) |
void |
close() |
static MBeanServer |
getDefaultMBeanServer()
Retrieves default MBean Server.
|
protected abstract void |
perObject(io.micrometer.core.instrument.MeterRegistry registry,
ObjectName objectName) |
protected void |
registerListener(ObjectName objectName,
NotificationListener notificationListener,
NotificationFilter filter)
Registers a MBean listener and prepares the related close hook.
|
protected void |
registerNotificationListener(io.micrometer.core.instrument.MeterRegistry registry,
java.util.function.BiConsumer<io.micrometer.core.instrument.MeterRegistry,ObjectName> perObject)
Prepares an registers the listener for new MBeans and prepares the related close hook.
|
public static final String JMX_DOMAIN
public static final String METRIC_NAME_PREFIX
protected final MBeanServer mBeanServer
protected final double convertionRatio
public AbstractMRulesMetrics()
public AbstractMRulesMetrics(TimeUnit timeUnit)
timeUnit
- public AbstractMRulesMetrics(MBeanServer mBeanServer)
mBeanServer
- public AbstractMRulesMetrics(MBeanServer mBeanServer, TimeUnit timeUnit)
mBeanServer
- timeUnit
- public static MBeanServer getDefaultMBeanServer()
public void bindTo(@NonNull io.micrometer.core.instrument.MeterRegistry registry)
bindTo
in interface io.micrometer.core.instrument.binder.MeterBinder
protected abstract void perObject(io.micrometer.core.instrument.MeterRegistry registry, ObjectName objectName)
protected void registerNotificationListener(io.micrometer.core.instrument.MeterRegistry registry, java.util.function.BiConsumer<io.micrometer.core.instrument.MeterRegistry,ObjectName> perObject)
perObject(MeterRegistry, ObjectName)
will be invoked for each new MBean.protected void registerListener(ObjectName objectName, NotificationListener notificationListener, NotificationFilter filter)
public void close()
close
in interface AutoCloseable