Skip to content

Instantly share code, notes, and snippets.

@nitsanw
Last active August 29, 2015 14:02
@State(Scope.Group)
public class CounterBenchmark {
private Counter counter;
@Param// This will default to running through all the counter types
CounterFactory.CounterType counterType;
@Setup
public void buildMeCounterHearty() {
counter = CounterFactory.build(counterType);
}
@Benchmark
@Group("rw")
public void inc() {
counter.inc();
}
@Benchmark
@Group("rw")
public long get() {
return counter.get();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment