use of com.navercorp.pinpoint.thrift.dto.TSqlMetaData in project pinpoint by naver.
the class TestTcpDataSender method addData.
private void addData(TBase<?, ?> data) {
if (data instanceof TApiMetaData) {
TApiMetaData md = (TApiMetaData) data;
final String javaMethodDescriptor = toJavaMethodDescriptor(md);
apiIdMap.put(md.getApiId(), javaMethodDescriptor);
} else if (data instanceof TSqlMetaData) {
TSqlMetaData md = (TSqlMetaData) data;
int id = md.getSqlId();
String sql = md.getSql();
sqlIdMap.put(id, sql);
} else if (data instanceof TStringMetaData) {
TStringMetaData md = (TStringMetaData) data;
int id = md.getStringId();
String string = md.getStringValue();
stringIdMap.put(id, string);
}
datas.add(data);
}
use of com.navercorp.pinpoint.thrift.dto.TSqlMetaData in project pinpoint by naver.
the class DefaultSqlMetaDataService method cacheSql.
@Override
public boolean cacheSql(ParsingResult parsingResult) {
if (parsingResult == null) {
return false;
}
// lazy sql parsing
boolean isNewValue = this.cachingSqlNormalizer.normalizedSql(parsingResult);
if (isNewValue) {
if (isDebug) {
// TODO logging hit ratio could help debugging
logger.debug("NewSQLParsingResult:{}", parsingResult);
}
// isNewValue means that the value is newly cached.
// So the sql could be new one. We have to send sql metadata to collector.
final TSqlMetaData sqlMetaData = new TSqlMetaData();
sqlMetaData.setAgentId(agentId);
sqlMetaData.setAgentStartTime(agentStartTime);
sqlMetaData.setSqlId(parsingResult.getId());
sqlMetaData.setSql(parsingResult.getSql());
this.enhancedDataSender.request(sqlMetaData);
}
return isNewValue;
}
Aggregations