use of com.navercorp.pinpoint.profiler.sender.UdpDataSender in project pinpoint by naver.
the class UdpDataSenderTest method sendAndFlushCheck.
@Test
public void sendAndFlushCheck() throws InterruptedException {
UdpDataSender sender = new UdpDataSender("localhost", PORT, "test", 128, 1000, 1024 * 64 * 100);
TAgentInfo agentInfo = new TAgentInfo();
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.send(agentInfo);
sender.stop();
}
use of com.navercorp.pinpoint.profiler.sender.UdpDataSender in project pinpoint by naver.
the class UdpDataSenderTest method sendMessage_getLimit.
private boolean sendMessage_getLimit(TBase tbase, long waitTimeMillis) throws InterruptedException {
final AtomicBoolean limitCounter = new AtomicBoolean(false);
final CountDownLatch latch = new CountDownLatch(1);
UdpDataSender sender = new UdpDataSender("localhost", PORT, "test", 128, 1000, 1024 * 64 * 100) {
@Override
protected boolean isLimit(int interBufferSize) {
boolean limit = super.isLimit(interBufferSize);
limitCounter.set(limit);
latch.countDown();
return limit;
}
};
try {
sender.send(tbase);
latch.await(waitTimeMillis, TimeUnit.MILLISECONDS);
} finally {
sender.stop();
}
return limitCounter.get();
}
Aggregations