Class CustomMeter.Noop<T>

All Implemented Interfaces:
CustomMeter<T>, IpdMeter
Enclosing interface:
CustomMeter<T>

public static class CustomMeter.Noop<T> extends IpdMeter.NoopMeter implements CustomMeter<T>
  • Constructor Details

  • Method Details

    • getMBeanObject

      public T getMBeanObject()
      Description copied from interface: CustomMeter
      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.
      Direct updates won't be logged to file when the meter is configured as MeterConfigBuilder.setLogOnUpdate(boolean).

      Do not keep this MBeanObject instance long-term.
      Specified by:
      getMBeanObject in interface CustomMeter<T>
      Returns:
      the object that will be exposed to JMX
    • getTypeId

      public String getTypeId()
      Description copied from interface: IpdMeter
      Identifies type of the meter.
      Specified by:
      getTypeId in interface IpdMeter
      Returns:
      Type ID of the meter
    • update

      public void update(Consumer<T> updater)
      Description copied from interface: CustomMeter
      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).

      Specified by:
      update in interface CustomMeter<T>
      Parameters:
      updater - function that updates the meter state