final int port = conf.getCollectorPort() + 1;
final ThriftEventSource tes = new ThriftEventSource(port);
tes.open();
final CounterSink cnt = new CounterSink("count");
cnt.open();
Thread t = new Thread("drain") {
public void run() {
try {
EventUtil.dumpAll(tes, cnt);
} catch (IOException e) {