Class LogbackReporter.Builder

  • Enclosing class:
    LogbackReporter

    public static class LogbackReporter.Builder
    extends java.lang.Object
    A builder for ConsoleReporter instances. Defaults to using the default locale and time zone, writing to System.out, converting rates to events/second, converting durations to milliseconds, and not filtering metrics.
    • Method Detail

      • formattedFor

        public LogbackReporter.Builder formattedFor​(java.util.Locale locale)
        Format numbers for the given Locale.
        Parameters:
        locale - a Locale
        Returns:
        this
      • withClock

        public LogbackReporter.Builder withClock​(com.codahale.metrics.Clock clock)
        Use the given Clock instance for the time.
        Parameters:
        clock - a Clock instance
        Returns:
        this
      • formattedFor

        public LogbackReporter.Builder formattedFor​(java.util.TimeZone timeZone)
        Use the given TimeZone for the time.
        Parameters:
        timeZone - a TimeZone
        Returns:
        this
      • convertRatesTo

        public LogbackReporter.Builder convertRatesTo​(java.util.concurrent.TimeUnit rateUnit)
        Convert rates to the given time unit.
        Parameters:
        rateUnit - a unit of time
        Returns:
        this
      • convertDurationsTo

        public LogbackReporter.Builder convertDurationsTo​(java.util.concurrent.TimeUnit durationUnit)
        Convert durations to the given time unit.
        Parameters:
        durationUnit - a unit of time
        Returns:
        this
      • filter

        public LogbackReporter.Builder filter​(com.codahale.metrics.MetricFilter filter)
        Only report metrics which match the given filter.
        Parameters:
        filter - a MetricFilter
        Returns:
        this
      • build

        public LogbackReporter build()
        Builds a ConsoleReporter with the given properties.
        Returns:
        a ConsoleReporter