Search in sources :

Example 1 with StringMetaData

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();
    }
}
Also used : StringMetaData(com.navercorp.pinpoint.profiler.metadata.StringMetaData) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) Test(org.junit.Test)

Example 2 with StringMetaData

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);
}
Also used : StringMetaData(com.navercorp.pinpoint.profiler.metadata.StringMetaData) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) Test(org.junit.Test)

Example 3 with StringMetaData

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);
}
Also used : StringMetaData(com.navercorp.pinpoint.profiler.metadata.StringMetaData) ApiMetaData(com.navercorp.pinpoint.profiler.metadata.ApiMetaData) SqlMetaData(com.navercorp.pinpoint.profiler.metadata.SqlMetaData)

Aggregations

StringMetaData (com.navercorp.pinpoint.profiler.metadata.StringMetaData)3 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)2 Test (org.junit.Test)2 ApiMetaData (com.navercorp.pinpoint.profiler.metadata.ApiMetaData)1 SqlMetaData (com.navercorp.pinpoint.profiler.metadata.SqlMetaData)1