@Test
public void testIntervalSampler() throws IOException, InterruptedException {
Benchmark b = new Benchmark("Interval sampler + nullsink");
b.mark("begin");
MemorySinkSource mem = FlumeBenchmarkHarness.synthInMem();
b.mark("disk_loaded");
NullSink nullsnk = new NullSink();
EventUtil.dumpAll(mem, nullsnk);
b.mark("warmup");
int interval_size[] = { 100000, 10000, 1000, 100 };
for (int i = 0; i < interval_size.length; i++) {
mem.open();
int sz = interval_size[i];
EventSink res = new IntervalSampler<NullSink>(new NullSink(), sz);
EventUtil.dumpAll(mem, res);
b.mark("interval " + sz + " sampling done", sz);
res.close();
b.mark("sample dump done");
}
for (int i = 0; i < interval_size.length; i++) {
mem.open();
int sz = interval_size[i];
CounterSink cnt = new CounterSink("null");
EventSink res = new IntervalSampler<CounterSink>(cnt, sz);
EventUtil.dumpAll(mem, res);
b.mark("interval", sz);