105106107108109110111112113114115
b.mark("interval", sz); res.close(); b.mark("count", cnt.getCount()); } b.done(); } @Test public void testProbabilitySampler() throws IOException, InterruptedException { Benchmark b = new Benchmark("Reservoir sampler + nullsink");
142143144145146147148149150
b.mark("probability", prob); res.close(); b.mark("count", cnt.getCount()); } b.done(); } }
4344454647484950515253
EventSink nullsnk = new NullSink(); EventUtil.dumpAll(mem, nullsnk); b.mark("nullsink done"); b.done(); } @Test public void testCountSink() throws IOException, InterruptedException { Benchmark b = new Benchmark("nullsink");
575859606162636465
CounterSink snk = new CounterSink("counter"); EventUtil.dumpAll(mem, snk); b.mark(snk.getName() + " done", snk.getCount()); b.done(); } }
234235236237238239240241242243244
Thread.sleep(1000); tes.close(); snk.close(); t.interrupt(); drain.interrupt(); b.done(); } /** * Here we are using the AvroRawEventSink instead of the AvroEventSink *
288289290291292293294295296
/ (double) (b.getLastDelta() / 1000)); tes.close(); snk.close(); drain.interrupt(); b.done(); } }
6667686970717273747576
b.mark("hdfs_copy_started"); hdfs.copyFromLocalFile(src, dst); b.mark("hdfs_copy_done"); hdfs.close(); b.done(); } @Test public void testDirectWrite() throws IOException, InterruptedException {
96979899100101102103104
} w.close(); b.mark("seqfile_hdfs_write"); hdfs.close(); b.done(); } }
6061626364656667686970
} catch (IOException io) { System.out.println(io); b.mark("conns", i); } src.close(); b.done(); } @Test public void testSurviveManyOpens() throws IOException, FlumeSpecException { Benchmark b = new Benchmark("connection exhaust");
8182838485868788
System.out.println(i + " connections..."); snk.close(); } src.close(); b.done(); } }