Search in sources :

Example 1 with ApiMetaData

use of com.navercorp.pinpoint.profiler.metadata.ApiMetaData 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)

Example 2 with ApiMetaData

use of com.navercorp.pinpoint.profiler.metadata.ApiMetaData in project pinpoint by naver.

the class MockApiMetaDataService method cacheApi.

@Override
public int cacheApi(final MethodDescriptor methodDescriptor) {
    final String fullName = methodDescriptor.getFullName();
    final Result result = this.apiCache.put(fullName);
    methodDescriptor.setApiId(result.getId());
    final ApiMetaData apiMetadata = new ApiMetaData(result.getId(), methodDescriptor.getApiDescriptor(), methodDescriptor.getLineNumber(), methodDescriptor.getType());
    this.enhancedDataSender.request(apiMetadata);
    return result.getId();
}
Also used : ApiMetaData(com.navercorp.pinpoint.profiler.metadata.ApiMetaData) Result(com.navercorp.pinpoint.profiler.metadata.Result)

Aggregations

ApiMetaData (com.navercorp.pinpoint.profiler.metadata.ApiMetaData)2 Result (com.navercorp.pinpoint.profiler.metadata.Result)1 SqlMetaData (com.navercorp.pinpoint.profiler.metadata.SqlMetaData)1 StringMetaData (com.navercorp.pinpoint.profiler.metadata.StringMetaData)1