Class CsvReporter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class CsvReporter
    extends ScheduledReporter
    A reporter which creates a comma-separated values file of the measurements for each metric.
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • UTF_8

        private static final java.nio.charset.Charset UTF_8
      • directory

        private final java.io.File directory
      • locale

        private final java.util.Locale locale
      • clock

        private final Clock clock
    • Constructor Detail

      • CsvReporter

        private CsvReporter​(MetricRegistry registry,
                            java.io.File directory,
                            java.util.Locale locale,
                            java.util.concurrent.TimeUnit rateUnit,
                            java.util.concurrent.TimeUnit durationUnit,
                            Clock clock,
                            MetricFilter filter)
    • Method Detail

      • report

        public void report​(java.util.SortedMap<java.lang.String,​Gauge> gauges,
                           java.util.SortedMap<java.lang.String,​Counter> counters,
                           java.util.SortedMap<java.lang.String,​Histogram> histograms,
                           java.util.SortedMap<java.lang.String,​Meter> meters,
                           java.util.SortedMap<java.lang.String,​Timer> timers)
        Description copied from class: ScheduledReporter
        Called periodically by the polling thread. Subclasses should report all the given metrics.
        Specified by:
        report in class ScheduledReporter
        Parameters:
        gauges - all of the gauges in the registry
        counters - all of the counters in the registry
        histograms - all of the histograms in the registry
        meters - all of the meters in the registry
        timers - all of the timers in the registry
      • reportTimer

        private void reportTimer​(long timestamp,
                                 java.lang.String name,
                                 Timer timer)
      • reportMeter

        private void reportMeter​(long timestamp,
                                 java.lang.String name,
                                 Meter meter)
      • reportHistogram

        private void reportHistogram​(long timestamp,
                                     java.lang.String name,
                                     Histogram histogram)
      • reportCounter

        private void reportCounter​(long timestamp,
                                   java.lang.String name,
                                   Counter counter)
      • reportGauge

        private void reportGauge​(long timestamp,
                                 java.lang.String name,
                                 Gauge gauge)
      • report

        private void report​(long timestamp,
                            java.lang.String name,
                            java.lang.String header,
                            java.lang.String line,
                            java.lang.Object... values)
      • sanitize

        protected java.lang.String sanitize​(java.lang.String name)