|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lens.server.api.metrics.MethodMetricGauge
public class MethodMetricGauge
Holds the gauge value indicating the time taken for the method.
When we have methods which can take variable time with respect to the parameters passed, the timers available in
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 Summary | |
---|---|
MethodMetricGauge(com.codahale.metrics.MetricRegistry metricRegistry,
String gaugeName)
The gauge for method time. |
Method Summary | |
---|---|
void |
markError()
Error came. |
void |
markSuccess()
Method succeeded. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 nameMethod Detail |
---|
public void markError()
MethodMetricsContext
markError
in interface MethodMetricsContext
public void markSuccess()
MethodMetricsContext
markSuccess
in interface MethodMetricsContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |