Package org.apache.solr.metrics
Class SolrMetricManager.GaugeWrapper<T>
- java.lang.Object
-
- org.apache.solr.metrics.SolrMetricManager.GaugeWrapper<T>
-
- All Implemented Interfaces:
com.codahale.metrics.Gauge<T>
,com.codahale.metrics.Metric
- Enclosing class:
- SolrMetricManager
public static class SolrMetricManager.GaugeWrapper<T> extends Object implements com.codahale.metrics.Gauge<T>
This is a wrapper forGauge
metrics, which are usually implemented as lambdas that often keep a reference to their parent instance. In order to make sure that all such metrics are removed when their parent instance is removed / closed the metric is associated with an instance tag, which can be used then to remove wrappers with the matching tag usingSolrMetricManager.unregisterGauges(String, String)
.
-
-
Constructor Summary
Constructors Constructor Description GaugeWrapper(com.codahale.metrics.Gauge<T> gauge, String tag)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.codahale.metrics.Gauge<T>
getGauge()
String
getTag()
T
getValue()
-