public class SolrMetricsContext extends Object
Modifier and Type | Field and Description |
---|---|
SolrMetricManager |
metricManager |
String |
registry |
String |
tag |
Constructor and Description |
---|
SolrMetricsContext(SolrMetricManager metricManager,
String registry,
String tag) |
Modifier and Type | Method and Description |
---|---|
com.codahale.metrics.Counter |
counter(SolrInfoBean info,
String metricName,
String... metricPath)
Convenience method for
SolrMetricManager.counter(SolrInfoBean, String, String, String...) . |
void |
gauge(SolrInfoBean info,
com.codahale.metrics.Gauge<?> gauge,
boolean force,
String metricName,
String... metricPath)
Convenience method for
SolrMetricManager.registerGauge(SolrInfoBean, String, Gauge, String, boolean, String, String...) . |
SolrMetricsContext |
getChildContext(Object child)
Get a context with the same registry name but a tag that represents a parent-child relationship.
|
com.codahale.metrics.MetricRegistry |
getMetricRegistry()
Get the MetricRegistry instance that is used for registering metrics in this context.
|
String |
getTag()
Metrics tag that represents objects with the same life-cycle.
|
com.codahale.metrics.Histogram |
histogram(SolrInfoBean info,
String metricName,
String... metricPath)
Convenience method for
SolrMetricManager.histogram(SolrInfoBean, String, String, String...) . |
com.codahale.metrics.Meter |
meter(SolrInfoBean info,
String metricName,
String... metricPath)
Convenience method for
SolrMetricManager.meter(SolrInfoBean, String, String, String...) . |
com.codahale.metrics.Timer |
timer(SolrInfoBean info,
String metricName,
String... metricPath)
Convenience method for
SolrMetricManager.meter(SolrInfoBean, String, String, String...) . |
void |
unregister()
Unregister all
Gauge metrics that use this context's tag. |
public final String registry
public final SolrMetricManager metricManager
public final String tag
public SolrMetricsContext(SolrMetricManager metricManager, String registry, String tag)
public String getTag()
public void unregister()
Gauge
metrics that use this context's tag.
NOTE: This method MUST be called at the end of a life-cycle (typically in close()
)
of components that register gauge metrics with references to the current object's instance. Failure to
do so may result in hard-to-debug memory leaks.
public SolrMetricsContext getChildContext(Object child)
child
- child object that produces metrics with a different life-cycle than the parent.public com.codahale.metrics.Meter meter(SolrInfoBean info, String metricName, String... metricPath)
SolrMetricManager.meter(SolrInfoBean, String, String, String...)
.public com.codahale.metrics.Counter counter(SolrInfoBean info, String metricName, String... metricPath)
SolrMetricManager.counter(SolrInfoBean, String, String, String...)
.public void gauge(SolrInfoBean info, com.codahale.metrics.Gauge<?> gauge, boolean force, String metricName, String... metricPath)
SolrMetricManager.registerGauge(SolrInfoBean, String, Gauge, String, boolean, String, String...)
.public com.codahale.metrics.Timer timer(SolrInfoBean info, String metricName, String... metricPath)
SolrMetricManager.meter(SolrInfoBean, String, String, String...)
.public com.codahale.metrics.Histogram histogram(SolrInfoBean info, String metricName, String... metricPath)
SolrMetricManager.histogram(SolrInfoBean, String, String, String...)
.public com.codahale.metrics.MetricRegistry getMetricRegistry()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.