Class CustomMeterImpl<T>
java.lang.Object
com.atlassian.diagnostics.ipd.api.meters.AbstractIpdMeter
com.atlassian.diagnostics.ipd.api.meters.custom.CustomMeterImpl<T>
- All Implemented Interfaces:
CustomMeter<T>,IpdMeter
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.diagnostics.ipd.api.meters.CustomMeter
CustomMeter.MBeanSupplier<BEAN_TYPE>, CustomMeter.Noop<T>Nested classes/interfaces inherited from interface com.atlassian.diagnostics.ipd.api.meters.IpdMeter
IpdMeter.NoopMeter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCustomMeterImpl(MeterConfig config, T mBean) protectedCustomMeterImpl(MeterConfig config, T mBean, MBeanServer mBeanServer) -
Method Summary
Modifier and TypeMethodDescriptionstatic <BEAN_TYPE>
MeterFactory<CustomMeter<BEAN_TYPE>> factory(CustomMeter.MBeanSupplier<BEAN_TYPE> mBeanSupplier) static <BEAN_TYPE>
MeterFactory<CustomMeter<BEAN_TYPE>> getAttributes(boolean extraAttributes) Returns the attributes of the meter.The returned object holds attribute data that are exposed to JMX.Identifies type of the meter.booleanMeter might be enabled, but temporarily hidden in JMX.protected voidRegisters the MBean in the MBeanServer.
Method will be called when the meter is enabled and is visible in JMX.protected voidUnregisters the MBean from the MBeanServer.voidUpdates the meter state by calling the updater function.Methods inherited from class com.atlassian.diagnostics.ipd.api.meters.AbstractIpdMeter
close, getConfig, getMeterKey, getObjectName, hideUntilUpdate, isClosed, isEnabled, lastUpdateMillis, metricUpdatedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.diagnostics.ipd.api.meters.IpdMeter
close, getConfig, getMeterKey, getObjectName, hideUntilUpdate, isClosed, isEnabled, lastUpdateMillis
-
Constructor Details
-
CustomMeterImpl
-
CustomMeterImpl
-
-
Method Details
-
getMBeanObject
Description copied from interface:CustomMeterThe 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).- Specified by:
getMBeanObjectin interfaceCustomMeter<T>- Returns:
- the object that will be exposed to JMX
-
getAttributes
Description copied from interface:IpdMeterReturns the attributes of the meter.- Specified by:
getAttributesin interfaceIpdMeter- Parameters:
extraAttributes- if true, all attributes visible in JMX will be returned, otherwise only the most important ones- Returns:
- Map of meter attributes, will return empty map if attributes can't be retrieved
-
isVisible
public boolean isVisible()Description copied from interface:IpdMeterMeter might be enabled, but temporarily hidden in JMX. This might happen when meter value was not set yet or methodIpdMeter.hideUntilUpdate()was called. -
registerMBean
protected void registerMBean()Description copied from class:AbstractIpdMeterRegisters the MBean in the MBeanServer.
Method will be called when the meter is enabled and is visible in JMX.- Specified by:
registerMBeanin classAbstractIpdMeter
-
unregisterMBean
protected void unregisterMBean()Description copied from class:AbstractIpdMeterUnregisters the MBean from the MBeanServer.
Method will be called when the meter is closed or is hidden from JMX.- Specified by:
unregisterMBeanin classAbstractIpdMeter
-
getTypeId
Description copied from interface:IpdMeterIdentifies type of the meter. -
update
Description copied from interface:CustomMeterUpdates 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).- Specified by:
updatein interfaceCustomMeter<T>- Parameters:
updater- function that updates the meter state
-
factory
-
factory
public static <BEAN_TYPE> MeterFactory<CustomMeter<BEAN_TYPE>> factory(CustomMeter.MBeanSupplier<BEAN_TYPE> mBeanSupplier)
-