use of org.collectd.protocol.UdpReceiver in project metrics by dropwizard.
the class Receiver method before.
@Override
protected void before() throws Throwable {
receiver = new UdpReceiver(new Dispatcher() {
@Override
public void dispatch(ValueList values) {
queue.offer(new ValueList(values));
}
@Override
public void dispatch(Notification notification) {
throw new UnsupportedOperationException();
}
});
receiver.setPort(port);
new Thread(() -> {
try {
receiver.listen();
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
use of org.collectd.protocol.UdpReceiver in project jcollectd by collectd.
the class MBeanSenderTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
_receiverTest = new ReceiverTest();
_receiverTest.setUp();
UdpReceiver receiver = _receiverTest.getReceiver();
receiver.setDispatcher(this);
int port = receiver.getSocket().getLocalPort();
_sender = new MBeanSender();
_sender.addDestination("udp://localhost:" + port);
}
Aggregations