codahale/metrics — Issue #153: Flaw in ConsoleReporter shutdown()
Author: niclash
Created: 2012-02-05 04:20:01+00:00
State: open

After shutting down a ConsoleReporter it is not possible to start a new one. The executor rejects the new schedule. Testcase to test it is;

import com.yammer.metrics.reporting.ConsoleReporter;
import java.util.concurrent.TimeUnit;
import org.junit.Test;

public class MetricsFlawTest
{
@Test
public void givenShutdownReporterWhenCreatingNewReporterExpectSuccess()
{
ConsoleReporter reporter1 = new ConsoleReporter( System.out );
reporter1.start( 1, TimeUnit.SECONDS );
reporter1.shutdown();
ConsoleReporter reporter2 = new ConsoleReporter( System.out );
reporter2.start( 1, TimeUnit.SECONDS );
}
}