Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.metrics.reporting;
An abstract base class for all reporter implementations which periodically poll registered metrics (e.g., to send the data to another service).
public abstract class AbstractPollingReporter extends AbstractReporter implements Runnable {
    private final ScheduledExecutorService executor;

Creates a new AbstractPollingReporter instance.

registry the com.yammer.metrics.core.MetricsRegistry containing the metrics this reporter will report
name the reporter's name
See also:
    protected AbstractPollingReporter(MetricsRegistry registryString name) {
        this. = registry.newScheduledThreadPool(1, name);

Starts the reporter polling at the given period.

period the amount of time between polls
unit the unit for period
    public void start(long periodTimeUnit unit) {

Shuts down the reporter polling, waiting the specific amount of time for any current polls to complete.

timeout the maximum time to wait
unit the unit for timeout
java.lang.InterruptedException if interrupted while waiting
    public void shutdown(long timeoutTimeUnit unitthrows InterruptedException {
    public void shutdown() {

The method called when a a poll is scheduled to occur.
    public abstract void run();
New to GrepCode? Check out our FAQ X