use of com.navercorp.pinpoint.thrift.dto.TSpan in project pinpoint by naver.
the class NetworkAvailabilityCheckPacketFilterTest method testFilter_Continue.
@Test
public void testFilter_Continue() throws Exception {
SocketAddress localSocketAddress = senderSocket.getLocalSocketAddress();
logger.debug("localSocket:{}", localSocketAddress);
TSpan skip = new TSpan();
boolean skipResult = filter.filter(receiverSocket, skip, null);
Assert.assertEquals(skipResult, TBaseFilter.CONTINUE);
}
use of com.navercorp.pinpoint.thrift.dto.TSpan in project pinpoint by naver.
the class SpanStreamSendDataSerializer method copySpanWithoutSpanEvent.
private TSpan copySpanWithoutSpanEvent(TSpan span) {
TSpan copiedSpan = span.deepCopy();
copiedSpan.setSpanEventList(Collections.EMPTY_LIST);
return copiedSpan;
}
use of com.navercorp.pinpoint.thrift.dto.TSpan in project pinpoint by naver.
the class ChunkHeaderBufferedTBaseSerializer method addTSpan.
// TSpan = TSpan + TSpanChunk
private void addTSpan(TBase<?, ?> base) throws TException {
final TSpan span = (TSpan) base;
if (span.getSpanEventList() == null) {
write(base);
return;
}
try {
for (TSpanEvent e : span.getSpanEventList()) {
eventStream.write(e);
}
write(span, FIELD_NAME_SPAN_EVENT_LIST, eventStream.split(chunkSize));
while (!eventStream.isEmpty()) {
final TSpanChunk spanChunk = toSpanChunk(span);
write(spanChunk, FIELD_NAME_SPAN_EVENT_LIST, eventStream.split(chunkSize));
}
} finally {
eventStream.clear();
}
}
use of com.navercorp.pinpoint.thrift.dto.TSpan in project pinpoint by naver.
the class SpanFactoryTest method testTransactionId_include_agentId.
@Test
public void testTransactionId_include_agentId() throws Exception {
TSpan tSpan = new TSpan();
tSpan.setAgentId("agentId");
byte[] transactionIdBytes = TransactionIdUtils.formatBytes("transactionAgentId", 1, 2);
tSpan.setTransactionId(transactionIdBytes);
SpanBo spanBo = spanFactory.newSpanBo(tSpan);
TransactionId transactionId = spanBo.getTransactionId();
Assert.assertEquals(transactionId.getAgentId(), "transactionAgentId");
Assert.assertEquals(transactionId.getAgentStartTime(), 1);
Assert.assertEquals(transactionId.getTransactionSequence(), 2);
}
use of com.navercorp.pinpoint.thrift.dto.TSpan in project pinpoint by naver.
the class SpanHandler method handleSimple.
public void handleSimple(TBase<?, ?> tbase) {
if (!(tbase instanceof TSpan)) {
throw new IllegalArgumentException("unexpected tbase:" + tbase + " expected:" + this.getClass().getName());
}
try {
final TSpan tSpan = (TSpan) tbase;
if (logger.isDebugEnabled()) {
logger.debug("Received SPAN={}", tSpan);
}
final SpanBo spanBo = spanFactory.buildSpanBo(tSpan);
traceDao.insert(spanBo);
applicationTraceIndexDao.insert(tSpan);
// insert statistics info for server map
insertAcceptorHost(spanBo);
insertSpanStat(spanBo);
insertSpanEventStat(spanBo);
} catch (Exception e) {
logger.warn("Span handle error. Caused:{}. Span:{}", e.getMessage(), tbase, e);
}
}
Aggregations