com.espertech.esper.metrics.codahale_metrics.metrics.reporting
Class AbstractPollingReporter

java.lang.Object
  extended by com.espertech.esper.metrics.codahale_metrics.metrics.reporting.AbstractReporter
      extended by com.espertech.esper.metrics.codahale_metrics.metrics.reporting.AbstractPollingReporter
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ConsoleReporter, CsvReporter

public abstract class AbstractPollingReporter
extends AbstractReporter
implements java.lang.Runnable

An abstract base class for all reporter implementations which periodically poll registered metrics (e.g., to send the data to another service).


Constructor Summary
protected AbstractPollingReporter(MetricsRegistry registry, java.lang.String name)
          Creates a new AbstractPollingReporter instance.
 
Method Summary
abstract  void run()
          The method called when a a poll is scheduled to occur.
 void shutdown()
          Stops the reporter and closes any internal resources.
 void shutdown(long timeout, java.util.concurrent.TimeUnit unit)
          Shuts down the reporter polling, waiting the specific amount of time for any current polls to complete.
 void start(long period, java.util.concurrent.TimeUnit unit)
          Starts the reporter polling at the given period.
 
Methods inherited from class com.espertech.esper.metrics.codahale_metrics.metrics.reporting.AbstractReporter
getMetricsRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPollingReporter

protected AbstractPollingReporter(MetricsRegistry registry,
                                  java.lang.String name)
Creates a new AbstractPollingReporter instance.

Parameters:
registry - the MetricsRegistry containing the metrics this reporter will report
name - the reporter's name
See Also:
AbstractReporter.AbstractReporter(MetricsRegistry)
Method Detail

start

public void start(long period,
                  java.util.concurrent.TimeUnit unit)
Starts the reporter polling at the given period.

Parameters:
period - the amount of time between polls
unit - the unit for period

shutdown

public void shutdown(long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException
Shuts down the reporter polling, waiting the specific amount of time for any current polls to complete.

Parameters:
timeout - the maximum time to wait
unit - the unit for timeout
Throws:
java.lang.InterruptedException - if interrupted while waiting

shutdown

public void shutdown()
Description copied from class: AbstractReporter
Stops the reporter and closes any internal resources.

Overrides:
shutdown in class AbstractReporter

run

public abstract void run()
The method called when a a poll is scheduled to occur.

Specified by:
run in interface java.lang.Runnable

© 2006-2016 EsperTech Inc.
All rights reserved.
Visit us at espertech.com