Class AbstractIpdMeter
java.lang.Object
com.atlassian.diagnostics.ipd.api.meters.AbstractIpdMeter
- All Implemented Interfaces:
IpdMeter
- Direct Known Subclasses:
CustomMeterImpl,IpdMeter.NoopMeter
Base class for all IPD meters. Shares common method implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.diagnostics.ipd.api.meters.IpdMeter
IpdMeter.NoopMeter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Permanently closes this instance of the meter.Meter configuration is constructed when meter is created for the first time and is immutable.ObjectName of the MBean.voidHides the meter in JMX until the next value update.booleanisClosed()Checks if the meter is closed.booleanlongReturns the timestamp of the last value update in milliseconds.protected voidprotected abstract voidRegisters the MBean in the MBeanServer.
Method will be called when the meter is enabled and is visible in JMX.protected abstract voidUnregisters the MBean from the MBeanServer.Methods 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
getAttributes, getTypeId, isVisible
-
Constructor Details
-
AbstractIpdMeter
-
-
Method Details
-
getConfig
Description copied from interface:IpdMeterMeter configuration is constructed when meter is created for the first time and is immutable. -
getMeterKey
- Specified by:
getMeterKeyin interfaceIpdMeter- Returns:
- MeterKey that identifies meter by name and tag values
-
getObjectName
Description copied from interface:IpdMeterObjectName of the MBean. Can be used to query this metric value in JMX.- Specified by:
getObjectNamein interfaceIpdMeter- Returns:
- ObjectName of this metric
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceIpdMeter- Returns:
- false if the meter is closed
IpdMeter.close()orMeterConfig.getEnabledCheck()check returns false, true otherwise
-
hideUntilUpdate
public void hideUntilUpdate()Description copied from interface:IpdMeterHides the meter in JMX until the next value update.IpdMeter.isVisible()will return false until the next value update.- Specified by:
hideUntilUpdatein interfaceIpdMeter
-
lastUpdateMillis
public long lastUpdateMillis()Description copied from interface:IpdMeterReturns the timestamp of the last value update in milliseconds. SeeClock.millis().- Specified by:
lastUpdateMillisin interfaceIpdMeter- Returns:
- timestamp of the last value update in milliseconds
-
metricUpdated
protected void metricUpdated() -
registerMBean
protected abstract void registerMBean()Registers the MBean in the MBeanServer.
Method will be called when the meter is enabled and is visible in JMX. -
unregisterMBean
protected abstract void unregisterMBean()Unregisters the MBean from the MBeanServer.
Method will be called when the meter is closed or is hidden from JMX. -
close
public void close()Description copied from interface:IpdMeterPermanently closes this instance of the meter. This instance will always return false forIpdMeter.isEnabled()andIpdMeter.isVisible().
This method is called on meter instances that are removed from theIpdRegistry -
isClosed
public boolean isClosed()Description copied from interface:IpdMeterChecks if the meter is closed. A closed meter can't be enabled or visible in JMX. It's a terminal state that is triggered when a meter is removed from the IpdRegistry. You can get a new instance of the meter from theIpdRegistry.
-