Package com.palantir.atlasdb.util
Class MetricsManager
- java.lang.Object
-
- com.palantir.atlasdb.util.MetricsManager
-
public class MetricsManager extends Object
-
-
Constructor Summary
Constructors Constructor Description MetricsManager(com.codahale.metrics.MetricRegistry metricRegistry, com.palantir.tritium.metrics.registry.TaggedMetricRegistry taggedMetricRegistry, com.palantir.refreshable.Refreshable<Boolean> performFiltering, java.util.function.Predicate<TableReference> isSafeToLog)
MetricsManager(com.codahale.metrics.MetricRegistry metricRegistry, com.palantir.tritium.metrics.registry.TaggedMetricRegistry taggedMetricRegistry, java.util.function.Predicate<TableReference> isSafeToLog)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMetricFilter(com.palantir.tritium.metrics.registry.MetricName metricName, MetricPublicationFilter publicationFilter)
void
addMetricFilter(Class<?> clazz, String metricName, Map<String,String> tags, MetricPublicationFilter publicationFilter)
void
deregisterMetrics()
void
deregisterTaggedMetrics(java.util.function.Predicate<com.palantir.tritium.metrics.registry.MetricName> predicate)
void
doNotPublish(com.palantir.tritium.metrics.registry.MetricName metricName)
com.palantir.tritium.metrics.registry.TaggedMetricSet
getPublishableMetrics()
com.codahale.metrics.MetricRegistry
getRegistry()
Map<String,String>
getTableNameTagFor(TableReference tableRef)
com.palantir.tritium.metrics.registry.TaggedMetricRegistry
getTaggedRegistry()
void
registerMetric(Class<?> clazz, String metricName, com.codahale.metrics.Gauge<?> gauge)
<T> com.codahale.metrics.Gauge<T>
registerOrGet(Class<?> clazz, String metricName, com.codahale.metrics.Gauge<T> gauge, Map<String,String> tag)
Add a new gauge metric of the given name or get the existing gauge if it is already registered.com.codahale.metrics.Counter
registerOrGetCounter(Class<?> clazz, String counterName)
<M extends com.codahale.metrics.Gauge<?>>
MregisterOrGetGauge(Class<?> clazz, String metricName, java.util.function.Supplier<M> gaugeSupplier)
com.codahale.metrics.Histogram
registerOrGetHistogram(Class<?> clazz, String metricName)
com.codahale.metrics.Histogram
registerOrGetHistogram(Class<?> clazz, String metricName, java.util.function.Supplier<com.codahale.metrics.Histogram> histogramSupplier)
com.codahale.metrics.Meter
registerOrGetMeter(Class<?> clazz, String meterName)
com.codahale.metrics.Meter
registerOrGetMeter(Class<?> clazz, String metricPrefix, String meterName)
com.codahale.metrics.Counter
registerOrGetTaggedCounter(Class<?> clazz, String metricName, Map<String,String> tags)
com.codahale.metrics.Histogram
registerOrGetTaggedHistogram(Class<?> clazz, String metricName, Map<String,String> tags)
com.codahale.metrics.Histogram
registerOrGetTaggedHistogram(Class<?> clazz, String metricName, Map<String,String> tags, java.util.function.Supplier<com.codahale.metrics.Histogram> supplier)
com.codahale.metrics.Meter
registerOrGetTaggedMeter(Class<?> clazz, String metricName, Map<String,String> tags)
com.codahale.metrics.Timer
registerOrGetTimer(Class<?> clazz, String metricName)
-
-
-
Constructor Detail
-
MetricsManager
public MetricsManager(com.codahale.metrics.MetricRegistry metricRegistry, com.palantir.tritium.metrics.registry.TaggedMetricRegistry taggedMetricRegistry, java.util.function.Predicate<TableReference> isSafeToLog)
-
MetricsManager
public MetricsManager(com.codahale.metrics.MetricRegistry metricRegistry, com.palantir.tritium.metrics.registry.TaggedMetricRegistry taggedMetricRegistry, com.palantir.refreshable.Refreshable<Boolean> performFiltering, java.util.function.Predicate<TableReference> isSafeToLog)
-
-
Method Detail
-
getRegistry
public com.codahale.metrics.MetricRegistry getRegistry()
-
getTaggedRegistry
public com.palantir.tritium.metrics.registry.TaggedMetricRegistry getTaggedRegistry()
-
addMetricFilter
public void addMetricFilter(com.palantir.tritium.metrics.registry.MetricName metricName, MetricPublicationFilter publicationFilter)
-
addMetricFilter
public void addMetricFilter(Class<?> clazz, String metricName, Map<String,String> tags, MetricPublicationFilter publicationFilter)
-
doNotPublish
public void doNotPublish(com.palantir.tritium.metrics.registry.MetricName metricName)
-
getPublishableMetrics
public com.palantir.tritium.metrics.registry.TaggedMetricSet getPublishableMetrics()
-
registerMetric
public void registerMetric(Class<?> clazz, String metricName, com.codahale.metrics.Gauge<?> gauge)
-
registerOrGet
public <T> com.codahale.metrics.Gauge<T> registerOrGet(Class<?> clazz, String metricName, com.codahale.metrics.Gauge<T> gauge, Map<String,String> tag)
Add a new gauge metric of the given name or get the existing gauge if it is already registered.- Throws:
IllegalStateException
- if a non-gauge metric with the same name already exists.
-
getTableNameTagFor
public Map<String,String> getTableNameTagFor(@Nullable TableReference tableRef)
-
registerOrGetGauge
public <M extends com.codahale.metrics.Gauge<?>> M registerOrGetGauge(Class<?> clazz, String metricName, java.util.function.Supplier<M> gaugeSupplier)
-
registerOrGetHistogram
public com.codahale.metrics.Histogram registerOrGetHistogram(Class<?> clazz, String metricName)
-
registerOrGetHistogram
public com.codahale.metrics.Histogram registerOrGetHistogram(Class<?> clazz, String metricName, java.util.function.Supplier<com.codahale.metrics.Histogram> histogramSupplier)
-
registerOrGetTimer
public com.codahale.metrics.Timer registerOrGetTimer(Class<?> clazz, String metricName)
-
registerOrGetCounter
public com.codahale.metrics.Counter registerOrGetCounter(Class<?> clazz, String counterName)
-
registerOrGetMeter
public com.codahale.metrics.Meter registerOrGetMeter(Class<?> clazz, String meterName)
-
registerOrGetMeter
public com.codahale.metrics.Meter registerOrGetMeter(Class<?> clazz, String metricPrefix, String meterName)
-
registerOrGetTaggedMeter
public com.codahale.metrics.Meter registerOrGetTaggedMeter(Class<?> clazz, String metricName, Map<String,String> tags)
-
registerOrGetTaggedHistogram
public com.codahale.metrics.Histogram registerOrGetTaggedHistogram(Class<?> clazz, String metricName, Map<String,String> tags)
-
registerOrGetTaggedHistogram
public com.codahale.metrics.Histogram registerOrGetTaggedHistogram(Class<?> clazz, String metricName, Map<String,String> tags, java.util.function.Supplier<com.codahale.metrics.Histogram> supplier)
-
registerOrGetTaggedCounter
public com.codahale.metrics.Counter registerOrGetTaggedCounter(Class<?> clazz, String metricName, Map<String,String> tags)
-
deregisterMetrics
public void deregisterMetrics()
-
deregisterTaggedMetrics
public void deregisterTaggedMetrics(java.util.function.Predicate<com.palantir.tritium.metrics.registry.MetricName> predicate)
-
-