public class MethodMetricGauge extends Object implements MethodMetricsContext
MethodMetrics
(which aggregated values over all calls) does not provide information on how each call
performed. Having gauge for each call will solve the purpose, which resulted in this class.
The gauge added here should be created with unique name for each call so that the gauges are not lost to
the latest calls.Constructor and Description |
---|
MethodMetricGauge(com.codahale.metrics.MetricRegistry metricRegistry,
String gaugeName)
The gauge for method time.
|
public MethodMetricGauge(@NonNull com.codahale.metrics.MetricRegistry metricRegistry, @NonNull String gaugeName)
metricRegistry
- The metric registrygaugeName
- Gauge name.
It should be unique for each creation. Callers have to take care of passing unique namepublic void markError()
MethodMetricsContext
markError
in interface MethodMetricsContext
public void markSuccess()
MethodMetricsContext
markSuccess
in interface MethodMetricsContext
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.