use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class JedisPluginTest method jedis.
@Test
public void jedis() {
JedisMock jedis = new JedisMock("localhost", 6379);
try {
jedis.get("foo");
} finally {
close(jedis);
}
final List<SpanEvent> events = getCurrentSpanEvents();
assertEquals(1, events.size());
final SpanEvent eventBo = events.get(0);
assertEquals(HOST + ":" + PORT, eventBo.getEndPoint());
assertEquals("REDIS", eventBo.getDestinationId());
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class JedisPluginTest method pipeline.
@Test
public void pipeline() {
JedisMock jedis = new JedisMock("localhost", 6379);
try {
Pipeline pipeline = jedis.pipelined();
pipeline.get("foo");
} finally {
close(jedis);
}
final List<SpanEvent> events = getCurrentSpanEvents();
assertEquals(1, events.size());
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class PluginVerifierExternalAdaptor method getServiceTypeCode.
private short getServiceTypeCode(SpanType spanType) {
if (spanType instanceof Span) {
final Span span = (Span) spanType;
return span.getServiceType();
}
if (spanType instanceof SpanChunk) {
final SpanChunk spanChunk = (SpanChunk) spanType;
List<SpanEvent> spanEventList = spanChunk.getSpanEventList();
if (spanEventList.size() != 1) {
throw new IllegalStateException("unexpected spanEventList.size() !=1");
}
SpanEvent spanEvent = spanEventList.get(0);
return spanEvent.getServiceType();
}
return -1;
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class BasePinpointTest method getCurrentSpanEvents.
protected List<SpanEvent> getCurrentSpanEvents() {
List<SpanEvent> spanEvents = new ArrayList<>();
for (SpanType value : this.tBaseRecorder) {
if (value instanceof SpanChunk) {
final SpanChunk spanChunk = (SpanChunk) value;
for (SpanEvent tSpanEvent : spanChunk.getSpanEventList()) {
SpanEvent spanEvent = tSpanEvent;
spanEvents.add(spanEvent);
}
}
}
return spanEvents;
}
use of com.navercorp.pinpoint.profiler.context.SpanEvent in project pinpoint by naver.
the class ApplicationContextHandler method getExecutedMethod.
public List<String> getExecutedMethod() {
List<String> list = new ArrayList<>();
for (SpanType item : orderedSpanRecorder) {
if (item instanceof Span) {
Span span = (Span) item;
List<SpanEvent> spanEventList = span.getSpanEventList();
addApiDescription(list, spanEventList);
} else if (item instanceof SpanChunk) {
SpanChunk spanChunk = (SpanChunk) item;
List<SpanEvent> spanEventList = spanChunk.getSpanEventList();
addApiDescription(list, spanEventList);
}
}
return list;
}
Aggregations