Class MetricsManager


  • public class MetricsManager
    extends Object
    • 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)
      • 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.
      • 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)