Class SolrReporter

  • All Implemented Interfaces:
    com.codahale.metrics.Reporter, Closeable, AutoCloseable

    public class SolrReporter
    extends com.codahale.metrics.ScheduledReporter
    Implementation of ScheduledReporter that reports metrics from selected registries and sends them periodically as update requests to a selected Solr collection and to a configured handler.
    • Constructor Detail

      • SolrReporter

        public SolrReporter​(SolrClientCache solrClientCache,
                            boolean closeClientCache,
                            Supplier<String> urlProvider,
                            SolrMetricManager metricManager,
                            List<SolrReporter.Report> metrics,
                            String handler,
                            String reporterId,
                            TimeUnit rateUnit,
                            TimeUnit durationUnit,
                            org.apache.solr.common.params.SolrParams params,
                            boolean skipHistograms,
                            boolean skipAggregateValues,
                            boolean cloudClient,
                            boolean compact)
        Create a SolrReporter instance.
        solrClientCache - client cache to use for constructing SolrClient instances.
        urlProvider - what URL to send to.
        metricManager - metric manager
        metrics - metric specifications to report
        handler - handler name to report to
        reporterId - my reporter id
        rateUnit - rate unit
        durationUnit - duration unit
        params - request parameters
        skipHistograms - if true then don't send histogram metrics
        skipAggregateValues - if true then don't send aggregate metrics' individual values
        cloudClient - if true then use CloudSolrClient, plain HttpSolrClient otherwise.
        compact - if true then use compact representation.
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        close in class com.codahale.metrics.ScheduledReporter
      • report

        public void report()
        report in class com.codahale.metrics.ScheduledReporter
      • report

        public void report​(SortedMap<String,​com.codahale.metrics.Gauge> gauges,
                           SortedMap<String,​com.codahale.metrics.Counter> counters,
                           SortedMap<String,​com.codahale.metrics.Histogram> histograms,
                           SortedMap<String,​com.codahale.metrics.Meter> meters,
                           SortedMap<String,​com.codahale.metrics.Timer> timers)
        Specified by:
        report in class com.codahale.metrics.ScheduledReporter