use of com.navercorp.pinpoint.profiler.metadata.StringMetaData in project pinpoint by naver.
the class NioUdpDataSenderTest method sendTest1.
@Test
public void sendTest1() throws Exception {
NioUDPDataSender<MetaDataType> sender = newNioUdpDataSender();
int sendMessageCount = 10;
for (int i = 0; i < 10; i++) {
MetaDataType metaData = new StringMetaData(i, "test");
sender.send(metaData);
}
try {
waitMessageReceived(sendMessageCount);
} finally {
sender.stop();
}
}
use of com.navercorp.pinpoint.profiler.metadata.StringMetaData in project pinpoint by naver.
the class NioUdpDataSenderTest method exceedMessageSendTest.
@Test(expected = IOException.class)
public void exceedMessageSendTest() throws IOException {
String random = RandomStringUtils.randomAlphabetic(ThriftUdpMessageSerializer.UDP_MAX_PACKET_LENGTH + 100);
MetaDataType metaData = new StringMetaData(1, random);
NioUDPDataSender<MetaDataType> sender = newNioUdpDataSender();
sender.send(metaData);
waitMessageReceived(1);
}
use of com.navercorp.pinpoint.profiler.metadata.StringMetaData in project pinpoint by naver.
the class TestTcpDataSender method addData.
private void addData(MetaDataType data) {
if (data instanceof ApiMetaData) {
ApiMetaData md = (ApiMetaData) data;
int apiId = md.getApiId();
String javaMethodDescriptor = toJavaMethodDescriptor(md);
syncPut(this.apiIdMap, apiId, javaMethodDescriptor);
} else if (data instanceof SqlMetaData) {
SqlMetaData md = (SqlMetaData) data;
int id = md.getSqlId();
String sql = md.getSql();
syncPut(sqlIdMap, id, sql);
} else if (data instanceof StringMetaData) {
StringMetaData md = (StringMetaData) data;
int id = md.getStringId();
String string = md.getStringValue();
syncPut(stringIdMap, id, string);
}
datas.add(data);
}
Aggregations