Interface CustomMeter<T>
- Type Parameters:
T- T is a class which implements an interface annotated withMXBean. Getters on this interface define the exposed JMX attributes.
- All Superinterfaces:
IpdMeter
- All Known Implementing Classes:
CustomMeter.Noop,CustomMeterImpl
Interface representing a custom meter, which is a type of
IpdMeter.
A custom meter is used to expose custom attributes to JMX and log file through the IPD framework.
You can define custom attributes by creating a class which implements an interface annotated with MXBean.
Getters on this interface define the exposed JMX attributes.
Your class implementation must be thread safe.
IpdConnectionStateIpdLongBucketsCounter-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classHelper class which supplies a new instance of CustomMBean.static classNested classes/interfaces inherited from interface com.atlassian.diagnostics.ipd.api.meters.IpdMeter
IpdMeter.NoopMeter -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionThe returned object holds attribute data that are exposed to JMX.static <T> MeterFactory<CustomMeter<T>> noopFactory(CustomMeter.MBeanSupplier<T> mBeanSupplier) voidUpdates the meter state by calling the updater function.Methods inherited from interface com.atlassian.diagnostics.ipd.api.meters.IpdMeter
close, getAttributes, getConfig, getMeterKey, getObjectName, getTypeId, hideUntilUpdate, isClosed, isEnabled, isVisible, lastUpdateMillis
-
Field Details
-
TYPE_ID
- See Also:
-
-
Method Details
-
noopFactory
-
getMBeanObject
T getMBeanObject()The returned object holds attribute data that are exposed to JMX. You can update the meter state directly by calling methods on this instance.However, any changes made through this instance will bypass enabled checks of this meter.
Do not keep this MBeanObject instance long-term.
Direct updates won't be logged to file when the meter is configured asMeterConfigBuilder.setLogOnUpdate(boolean).- Returns:
- the object that will be exposed to JMX
-
update
Updates the meter state by calling the updater function. Updater function will be called only when the meter is enabled.Updates made through this instance will be logged to file when the meter is configured as
MeterConfigBuilder.setLogOnUpdate(boolean).- Parameters:
updater- function that updates the meter state
-