Class ClientMetricUpdater

  • All Implemented Interfaces:
    MetricNotifier, java.lang.AutoCloseable

    public class ClientMetricUpdater
    extends java.lang.Object
    implements MetricNotifier
    A MetricNotifier that invokes the MetricListener provided by the user. This notifier skips updates if multiple updates are performed while the MetricListener is processing, only the most recent update is used.
    • Constructor Detail

      • ClientMetricUpdater

        public ClientMetricUpdater​(MetricListener metricListener)
    • Method Detail

      • updateSuccessMetric

        public void updateSuccessMetric​(ClientMetricKeys metricKey,
                                        java.lang.String[] metricTags,
                                        long value)
        Description copied from interface: MetricNotifier
        Notify a success metric to the user specified MetricListener.
        Specified by:
        updateSuccessMetric in interface MetricNotifier
        Parameters:
        metricKey - The metric key.
        metricTags - Tags associated with the metric.
        value - Value of the metric observed.
      • updateFailureMetric

        public void updateFailureMetric​(ClientMetricKeys metricKey,
                                        java.lang.String[] metric,
                                        long value)
        Description copied from interface: MetricNotifier
        Notify a failure metric to the user specified MetricListener.
        Specified by:
        updateFailureMetric in interface MetricNotifier
        Parameters:
        metricKey - The metric key.
        metric - Tags associated with the metric.
        value - Value of the metric observed.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface MetricNotifier