Class NoOpMetricsClient

java.lang.Object
com.itrsgroup.collection.instr.NoOpMetricsClient
All Implemented Interfaces:
MetricsClient, AutoCloseable

public final class NoOpMetricsClient extends Object implements MetricsClient
No-op implementation of MetricsClient.

All methods do nothing.

  • Constructor Details

    • NoOpMetricsClient

      public NoOpMetricsClient()
  • Method Details

    • close

      public void close()
      Description copied from interface: MetricsClient
      Overridden to remove checked exception constraint.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface MetricsClient
    • increment

      public void increment(String metric)
      Description copied from interface: MetricsClient
      Increment the counter by 1.
      Specified by:
      increment in interface MetricsClient
      Parameters:
      metric - metric name
    • increment

      public void increment(String metric, double sampleRate)
      Description copied from interface: MetricsClient
      Increment the counter by 1.

      This uses sampling in order to approximate the actual number of increments. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      increment in interface MetricsClient
      Parameters:
      metric - metric name
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
    • increment

      public void increment(String metric, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Increment the counter by 1.
      Specified by:
      increment in interface MetricsClient
      Parameters:
      metric - metric name
      dimensions - dimensions identifying the entity
    • increment

      public void increment(String metric, double sampleRate, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Increment the counter by 1.

      This uses sampling in order to approximate the actual number of increments. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      increment in interface MetricsClient
      Parameters:
      metric - metric name
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
      dimensions - dimensions identifying the entity
    • decrement

      public void decrement(String metric)
      Description copied from interface: MetricsClient
      Decrement the counter by 1.
      Specified by:
      decrement in interface MetricsClient
      Parameters:
      metric - metric name
    • decrement

      public void decrement(String metric, double sampleRate)
      Description copied from interface: MetricsClient
      Decrement the counter by 1.

      This uses sampling in order to approximate the actual number of increments. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      decrement in interface MetricsClient
      Parameters:
      metric - metric name
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
    • decrement

      public void decrement(String metric, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Decrement the counter by 1.
      Specified by:
      decrement in interface MetricsClient
      Parameters:
      metric - metric name
      dimensions - dimensions identifying the entity
    • decrement

      public void decrement(String metric, double sampleRate, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Decrement the counter by 1.

      This uses sampling in order to approximate the actual number of increments. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      decrement in interface MetricsClient
      Parameters:
      metric - metric name
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
      dimensions - dimensions identifying the entity
    • count

      public void count(String metric, long delta)
      Description copied from interface: MetricsClient
      Adjust the counter value.
      Specified by:
      count in interface MetricsClient
      Parameters:
      metric - metric name
      delta - adjustment value
    • count

      public void count(String metric, long delta, double sampleRate)
      Description copied from interface: MetricsClient
      Adjust the counter value.

      This uses sampling in order to approximate the actual number of increments. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      count in interface MetricsClient
      Parameters:
      metric - metric name
      delta - adjustment value
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
    • count

      public void count(String metric, long delta, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Adjust the counter value.
      Specified by:
      count in interface MetricsClient
      Parameters:
      metric - metric name
      delta - adjustment value
      dimensions - dimensions identifying the entity
    • count

      public void count(String metric, long delta, double sampleRate, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Adjust the counter value.

      This uses sampling in order to approximate the actual number of increments. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      count in interface MetricsClient
      Parameters:
      metric - metric name
      delta - adjustment value
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
      dimensions - dimensions identifying the entity
    • gauge

      public void gauge(String metric, DoubleSupplier supplier)
      Description copied from interface: MetricsClient
      Register periodic sampling of a gauge.

      The client will sample the value at its configured sampling interval.

      This method should only be called once per unique combination of metric name and dimensions. Duplicate registrations are ignored and may be reported via an implementation-specific error handler.

      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      supplier - value supplier called once per sampling interval
    • gauge

      public void gauge(String metric, DoubleSupplier supplier, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Register periodic sampling of a gauge.

      The client will sample the value at its configured sampling interval.

      This method should only be called once per unique combination of metric name and dimensions. Duplicate registrations are ignored and may be reported via an implementation-specific error handler.

      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      supplier - value supplier called once per sampling interval
      dimensions - dimensions identifying the entity
    • gauge

      public void gauge(String metric, DoubleSupplier supplier, Unit unit)
      Description copied from interface: MetricsClient
      Register periodic sampling of a gauge.

      The client will sample the value at its configured sampling interval.

      This method should only be called once per unique combination of metric name and dimensions. Duplicate registrations are ignored and may be reported via an implementation-specific error handler.

      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      supplier - value supplier called once per sampling interval
      unit - unit of measure
    • gauge

      public void gauge(String metric, DoubleSupplier supplier, Unit unit, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Register periodic sampling of a gauge.

      The client will sample the value at its configured sampling interval.

      This method should only be called once per unique combination of metric name and dimensions. Duplicate registrations are ignored and may be reported via an implementation-specific error handler.

      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      supplier - value supplier called once per sampling interval
      unit - unit of measure
      dimensions - dimensions identifying the entity
    • gauge

      public void gauge(String metric, double absoluteValue)
      Description copied from interface: MetricsClient
      Set the specified gauge's value.
      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      absoluteValue - absolute value
    • gauge

      public void gauge(String metric, double absoluteValue, Unit unit)
      Description copied from interface: MetricsClient
      Set the specified gauge's value.
      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      absoluteValue - absolute value
      unit - unit of measure
    • gauge

      public void gauge(String metric, double absoluteValue, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Set the specified gauge's value.
      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      absoluteValue - absolute value
      dimensions - dimensions identifying the entity
    • gauge

      public void gauge(String metric, double absoluteValue, Unit unit, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Set the specified gauge's value.
      Specified by:
      gauge in interface MetricsClient
      Parameters:
      metric - metric name
      absoluteValue - absolute value
      unit - unit of measure
      dimensions - dimensions identifying the entity
    • adjustGauge

      public void adjustGauge(String metric, double delta)
      Description copied from interface: MetricsClient
      Adjust the specified gauge's value.
      Specified by:
      adjustGauge in interface MetricsClient
      Parameters:
      metric - metric name
      delta - amount to adjust by
    • adjustGauge

      public void adjustGauge(String metric, double delta, Unit unit)
      Description copied from interface: MetricsClient
      Adjust the specified gauge's value.
      Specified by:
      adjustGauge in interface MetricsClient
      Parameters:
      metric - metric name
      delta - amount to adjust by
      unit - unit of measure
    • adjustGauge

      public void adjustGauge(String metric, double delta, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Adjust the specified gauge's value.
      Specified by:
      adjustGauge in interface MetricsClient
      Parameters:
      metric - metric name
      delta - amount to adjust by
      dimensions - dimensions identifying the entity
    • adjustGauge

      public void adjustGauge(String metric, double delta, Unit unit, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Adjust the specified gauge's value.
      Specified by:
      adjustGauge in interface MetricsClient
      Parameters:
      metric - metric name
      delta - amount to adjust by
      unit - unit of measure
      dimensions - dimensions identifying the entity
    • removeGaugeSampler

      public void removeGaugeSampler(String metric)
      Description copied from interface: MetricsClient
      Remove a periodically sampled gauge that was registered via MetricsClient.gauge(String, DoubleSupplier) or MetricsClient.gauge(String, DoubleSupplier, Unit).

      The metric name must correspond exactly to the original registration. The unit is ignored.

      Specified by:
      removeGaugeSampler in interface MetricsClient
      Parameters:
      metric - metric name
    • removeGaugeSampler

      public void removeGaugeSampler(String metric, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Remove a periodically sampled gauge that was registered via MetricsClient.gauge(String, DoubleSupplier, Set) or MetricsClient.gauge(String, DoubleSupplier, Unit, Set).

      The metric name and dimensions must correspond exactly to the original registration. The unit is ignored.

      Specified by:
      removeGaugeSampler in interface MetricsClient
      Parameters:
      metric - metric name
      dimensions - dimensions
    • clearGaugeSamplers

      public void clearGaugeSamplers()
      Description copied from interface: MetricsClient
      Clear all periodically sampled gauges.
      Specified by:
      clearGaugeSamplers in interface MetricsClient
    • unique

      public void unique(String metric, String identifier)
      Description copied from interface: MetricsClient
      Report a unique value in a bucket or "set".

      The server will track the number of unique identifiers in the named set and report as a counter.

      Specified by:
      unique in interface MetricsClient
      Parameters:
      metric - set name
      identifier - unique identifier
    • unique

      public void unique(String metric, String identifier, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Report a unique value in a bucket or "set".

      The server will track the number of unique identifiers in the named set and report as a counter.

      Specified by:
      unique in interface MetricsClient
      Parameters:
      metric - set name
      identifier - unique identifier
      dimensions - dimensions identifying the entity
    • timer

      public void timer(String metric, long millis)
      Description copied from interface: MetricsClient
      Report elapsed time (in milliseconds) of an operation.
      Specified by:
      timer in interface MetricsClient
      Parameters:
      metric - timer name
      millis - elapsed milliseconds
    • timer

      public void timer(String metric, long millis, double sampleRate)
      Description copied from interface: MetricsClient
      Report elapsed time (in milliseconds) of an operation.

      This uses sampling in order to approximate the actual number of invocations. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      timer in interface MetricsClient
      Parameters:
      metric - timer name
      millis - elapsed milliseconds
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
    • timer

      public void timer(String metric, long millis, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Report elapsed time (in milliseconds) of an operation.
      Specified by:
      timer in interface MetricsClient
      Parameters:
      metric - timer name
      millis - elapsed milliseconds
      dimensions - dimensions identifying the entity
    • timer

      public void timer(String metric, long millis, double sampleRate, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Report elapsed time (in milliseconds) of an operation.

      This uses sampling in order to approximate the actual number of invocations. An update will be reported for only sampleRate * 100 percent of all invocations.

      Specified by:
      timer in interface MetricsClient
      Parameters:
      metric - timer name
      millis - elapsed milliseconds
      sampleRate - Percentage of invocations to actually report. If the specified value is zero or negative, nothing will be reported. If the value is 1 or greater, it will always report.
      dimensions - dimensions identifying the entity
    • event

      public void event(String name, String message, Severity severity)
      Description copied from interface: MetricsClient
      Report an event.

      The event will be immediately reported for.

      Specified by:
      event in interface MetricsClient
      Parameters:
      name - event name
      message - message
      severity - severity
    • event

      public void event(String name, String message, Severity severity, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Report an event.

      The event will be immediately reported for.

      Specified by:
      event in interface MetricsClient
      Parameters:
      name - event name
      message - message
      severity - severity
      dimensions - dimensions identifying the entity
    • attribute

      public void attribute(String name, String value)
      Description copied from interface: MetricsClient
      Set the specified attribute's value.
      Specified by:
      attribute in interface MetricsClient
      Parameters:
      name - attribute name
      value - attribute value
    • attribute

      public void attribute(String name, String value, Set<Dimension> dimensions)
      Description copied from interface: MetricsClient
      Set the specified attribute's value.
      Specified by:
      attribute in interface MetricsClient
      Parameters:
      name - attribute name
      value - attribute value
      dimensions - dimensions identifying the entity