Class NoopIpdRegistry
- All Implemented Interfaces:
IpdRegistry
IpdRegistry. This implementation does not record any metrics in JMX or log files.- Since:
- 5.0.0
-
Field Summary
Fields inherited from class com.atlassian.diagnostics.ipd.api.registry.AbstractIpdMeterRegistry
meterConfigurations, meters -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofNoopIpdRegistrywith all meters disabled by default.NoopIpdRegistry(MeterConfigurations meterConfigurations) -
Method Summary
Modifier and TypeMethodDescriptionReturns counter meter for a given name and tags.<T> CustomMeter<T> custom(String name, CustomMeter.MBeanSupplier<T> mBeanSupplier, MeterTag... tags) Returns custom meter for a given name, tags and instance.<T> CustomMeter<T> Returns custom meter for a given name, tags and type.Returns stats meter for a given name and tags.statsCopy(String name, ObjectName objectToCopy, MeterTag... tags) Returns an IPD meter which copies stats attributes of existing JMX meter.voidUnregisters all disabled metrics.Returns value meter for a given name and tags.Methods inherited from class com.atlassian.diagnostics.ipd.api.registry.AbstractIpdMeterRegistry
get, getMeterKeys, getMeterKeys, getMeters, getMeters, register, remove, removeAll, removeAll, removeAllWithAnyTag, removeIf, removeIf, retainIf, shutdownMethods 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.registry.IpdRegistry
addStats, addStats, incrementCounter, setValue, valueAndStats
-
Constructor Details
-
NoopIpdRegistry
-
NoopIpdRegistry
public NoopIpdRegistry()Creates a new instance ofNoopIpdRegistrywith all meters disabled by default.
-
-
Method Details
-
value
Description copied from interface:IpdRegistryReturns value meter for a given name and tags.- Parameters:
name- meter nametags- meter tags- Returns:
- Existing or new meter
-
stats
Description copied from interface:IpdRegistryReturns stats meter for a given name and tags.- Parameters:
name- meter nametags- meter tags- Returns:
- Existing or new meter
-
counter
Description copied from interface:IpdRegistryReturns counter meter for a given name and tags.- Parameters:
name- meter nametags- meter tags- Returns:
- Existing or new meter
-
custom
Description copied from interface:IpdRegistryReturns custom meter for a given name, tags and type.'type' parameter points to class which implements interface annotated with @MXBean. Getters in this interface will define meter attributes.
See 'type' example implementation
This class has to have no argument constructor.IpdConnectionState- Type Parameters:
T- Type defining meter attributes- Parameters:
name- metric nametype- points to custom meter MBean implementation. This class has to implement interface annotated with @MXBean. Getters in this interface will define meter attributes.tags- meter tags- Returns:
- existing or new meter
-
custom
public <T> CustomMeter<T> custom(String name, CustomMeter.MBeanSupplier<T> mBeanSupplier, MeterTag... tags) Description copied from interface:IpdRegistryReturns custom meter for a given name, tags and instance.'instance' object has to be of class which implements interface annotated with @MXBean. Getters in this interface will define meter attributes.
See 'type' example implementation
IpdConnectionStateImportant note:
Returned meter will reference given instance object only on creation. If CustomMeter for a give name and tags is already registered, it will be returned with the existing instance object and provided 'instance' parameter will be ignored.- Type Parameters:
T- Type defining meter attributes- Parameters:
name- metric namemBeanSupplier- this objects class has to implement interface annotated with @MXBean. Getters in this interface will define meter attributes.tags- meter tags- Returns:
- existing or new meter
-
statsCopy
Description copied from interface:IpdRegistryReturns an IPD meter which copies stats attributes of existing JMX meter. All attribute changes in the original metric will be reflected in JMX and log file after callingJmxCopyMeter.update().- Parameters:
name- meter name with postfixobjectToCopy- object name of the JMX bean to copy attributes fromtags- meter tags- Returns:
- existing or new meter
-
unregisterAllDisabledMetrics
public void unregisterAllDisabledMetrics()Description copied from interface:IpdRegistryUnregisters all disabled metrics.This method iterates through all registered `IpdMeter` instances and unregisters from JMX those that are disabled. Meters are considered disabled if their `IpdMeter#isEnabled` method returns `false`.
- Specified by:
unregisterAllDisabledMetricsin interfaceIpdRegistry- Overrides:
unregisterAllDisabledMetricsin classAbstractIpdMeterRegistry
-