Skip to content

Commit

Permalink
Moved default shutdownReporter impl to AbstractReporterBenchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Kudinkin committed Aug 13, 2021
1 parent 1b616f4 commit 8fd2ba2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ public void teardown() {
}

public abstract Reporter bootReporter();
public abstract void shutdownReporter(Reporter reporter);

public void shutdownReporter(Reporter reporter) {
reporter.close();
}

@State(Scope.Thread)
public static class Counter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,4 @@ public PrometheusReporter bootReporter() {
.build();
}

@Override
public void shutdownReporter(PrometheusReporter reporter) {
reporter.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@
import com.uber.m3.tally.AbstractReporterBenchmark;

public class StatsdReporterBenchmark extends AbstractReporterBenchmark<StatsdReporter> {

@Override
public StatsdReporter bootReporter() {
StatsDClient statsd = new NonBlockingStatsDClient("statsd-test", "localhost", 1235);
return new StatsdReporter(statsd);
}

@Override
public void shutdownReporter(StatsdReporter reporter) {
reporter.close();
}
}

0 comments on commit 8fd2ba2

Please sign in to comment.