Class ScheduledReporterManager

  • All Implemented Interfaces:
    Managed

    public class ScheduledReporterManager
    extends Object
    implements Managed
    Manages a ScheduledReporter lifecycle.
    • Constructor Detail

      • ScheduledReporterManager

        public ScheduledReporterManager​(com.codahale.metrics.ScheduledReporter reporter,
                                        Duration period)
        Manages the given reporter by reporting with the given period.
        Parameters:
        reporter - the reporter to manage.
        period - the frequency to report metrics at.
        See Also:
        ScheduledReporterManager(ScheduledReporter, Duration, boolean)
      • ScheduledReporterManager

        public ScheduledReporterManager​(com.codahale.metrics.ScheduledReporter reporter,
                                        Duration period,
                                        boolean reportOnStop)
        Manages the given reporter by reporting with the given period.
        Parameters:
        reporter - the reporter to manage.
        period - the frequency to report metrics at.
        reportOnStop - whether the reporter should send one last report upon stopping
        Since:
        2.0
    • Method Detail

      • start

        public void start()
                   throws Exception
        Begins reporting metrics using the configured ScheduledReporter.
        Specified by:
        start in interface Managed
        Throws:
        Exception
      • stop

        public void stop()
                  throws Exception
        Stops the configured ScheduledReporter from reporting metrics.
        Specified by:
        stop in interface Managed
        Throws:
        Exception