Package io.pravega.shared.metrics
Class ClientMetricUpdater
- java.lang.Object
-
- io.pravega.shared.metrics.ClientMetricUpdater
-
- All Implemented Interfaces:
MetricNotifier,java.lang.AutoCloseable
public class ClientMetricUpdater extends java.lang.Object implements MetricNotifier
A MetricNotifier that invokes theMetricListenerprovided by the user. This notifier skips updates if multiple updates are performed while the MetricListener is processing, only the most recent update is used.
-
-
Field Summary
-
Fields inherited from interface io.pravega.shared.metrics.MetricNotifier
NO_OP_METRIC_NOTIFIER
-
-
Constructor Summary
Constructors Constructor Description ClientMetricUpdater(MetricListener metricListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidupdateFailureMetric(ClientMetricKeys metricKey, java.lang.String[] metric, long value)Notify a failure metric to the user specifiedMetricListener.voidupdateSuccessMetric(ClientMetricKeys metricKey, java.lang.String[] metricTags, long value)Notify a success metric to the user specifiedMetricListener.
-
-
-
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:MetricNotifierNotify a success metric to the user specifiedMetricListener.- Specified by:
updateSuccessMetricin interfaceMetricNotifier- 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:MetricNotifierNotify a failure metric to the user specifiedMetricListener.- Specified by:
updateFailureMetricin interfaceMetricNotifier- Parameters:
metricKey- The metric key.metric- Tags associated with the metric.value- Value of the metric observed.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceMetricNotifier
-
-