Class NoopIpdRegistry

java.lang.Object
com.atlassian.diagnostics.ipd.api.registry.AbstractIpdMeterRegistry
com.atlassian.diagnostics.ipd.api.registry.NoopIpdRegistry
All Implemented Interfaces:
IpdRegistry

public class NoopIpdRegistry extends AbstractIpdMeterRegistry
A no-op implementation of IpdRegistry. This implementation does not record any metrics in JMX or log files.
Since:
5.0.0
  • Constructor Details

    • NoopIpdRegistry

      public NoopIpdRegistry(MeterConfigurations meterConfigurations)
    • NoopIpdRegistry

      public NoopIpdRegistry()
      Creates a new instance of NoopIpdRegistry with all meters disabled by default.
  • Method Details

    • value

      public ValueMeter value(String name, MeterTag... tags)
      Description copied from interface: IpdRegistry
      Returns value meter for a given name and tags.
      Parameters:
      name - meter name
      tags - meter tags
      Returns:
      Existing or new meter
    • stats

      public StatsMeter stats(String name, MeterTag... tags)
      Description copied from interface: IpdRegistry
      Returns stats meter for a given name and tags.
      Parameters:
      name - meter name
      tags - meter tags
      Returns:
      Existing or new meter
    • counter

      public CounterMeter counter(String name, MeterTag... tags)
      Description copied from interface: IpdRegistry
      Returns counter meter for a given name and tags.
      Parameters:
      name - meter name
      tags - meter tags
      Returns:
      Existing or new meter
    • custom

      public <T> CustomMeter<T> custom(String name, Class<T> type, MeterTag... tags)
      Description copied from interface: IpdRegistry
      Returns 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.
      This class has to have no argument constructor.

      See 'type' example implementation IpdConnectionState
      Type Parameters:
      T - Type defining meter attributes
      Parameters:
      name - metric name
      type - 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: IpdRegistry
      Returns 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 IpdConnectionState

      Important 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 name
      mBeanSupplier - 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

      public JmxCopyMeter statsCopy(String name, ObjectName objectToCopy, MeterTag... tags)
      Description copied from interface: IpdRegistry
      Returns 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 calling JmxCopyMeter.update().
      Parameters:
      name - meter name with postfix
      objectToCopy - object name of the JMX bean to copy attributes from
      tags - meter tags
      Returns:
      existing or new meter
    • unregisterAllDisabledMetrics

      public void unregisterAllDisabledMetrics()
      Description copied from interface: IpdRegistry
      Unregisters 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:
      unregisterAllDisabledMetrics in interface IpdRegistry
      Overrides:
      unregisterAllDisabledMetrics in class AbstractIpdMeterRegistry