Class ConsoleReporter

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

    public class ConsoleReporter
    extends ScheduledReporter
    A reporter which outputs measurements to a PrintStream, like System.out.
    • Field Detail

      • output

        private final java.io.PrintStream output
      • locale

        private final java.util.Locale locale
      • clock

        private final Clock clock
      • dateFormat

        private final java.text.DateFormat dateFormat
    • Constructor Detail

      • ConsoleReporter

        private ConsoleReporter​(MetricRegistry registry,
                                java.io.PrintStream output,
                                java.util.Locale locale,
                                Clock clock,
                                java.util.TimeZone timeZone,
                                java.util.concurrent.TimeUnit rateUnit,
                                java.util.concurrent.TimeUnit durationUnit,
                                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
      • printMeter

        private void printMeter​(Meter meter)
      • printCounter

        private void printCounter​(java.util.Map.Entry<java.lang.String,​Counter> entry)
      • printGauge

        private void printGauge​(java.util.Map.Entry<java.lang.String,​Gauge> entry)
      • printHistogram

        private void printHistogram​(Histogram histogram)
      • printTimer

        private void printTimer​(Timer timer)
      • printWithBanner

        private void printWithBanner​(java.lang.String s,
                                     char c)