Class ScheduledReporter

    • Method Detail

      • start

        public void start​(long period,
                          TimeUnit unit)
        Starts the reporter polling at the given period.
        Parameters:
        period - the amount of time between polls
        unit - the unit for period
      • start

        public void start​(long initialDelay,
                          long period,
                          TimeUnit unit)
        Starts the reporter polling at the given period.
        Parameters:
        initialDelay - the time to delay the first execution
        period - the amount of time between polls
        unit - the unit for period and initialDelay
      • stop

        public void stop()
        Stops the reporter and if shutdownExecutorOnStop is true then shuts down its thread of execution.

        Uses the shutdown pattern from http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html

      • close

        public void close()
        Stops the reporter and shuts down its thread of execution.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
      • report

        public void report()
        Report the current values of all metrics in the registry.
      • getRateUnit

        public String getRateUnit()
      • getDurationUnit

        public String getDurationUnit()
      • convertDuration

        public double convertDuration​(double duration)
      • convertRate

        public double convertRate​(double rate)
      • isShutdownExecutorOnStop

        public boolean isShutdownExecutorOnStop()