use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEventBitFieldTest method testNextSpanId_first.
@Test
public void testNextSpanId_first() throws Exception {
SpanEventBo spanEventBo = new SpanEventBo();
spanEventBo.setNextSpanId(1234);
SpanEventBitField bitField = SpanEventBitField.buildFirst(spanEventBo);
Assert.assertTrue(bitField.isSetNextSpanId());
bitField.setNextSpanId(false);
Assert.assertFalse(bitField.isSetNextSpanId());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class SpanEventBitFieldTest method testAnnotation_first.
@Test
public void testAnnotation_first() throws Exception {
SpanEventBo spanEventBo = new SpanEventBo();
spanEventBo.setAnnotationBoList(Lists.newArrayList(new AnnotationBo()));
SpanEventBitField bitField = SpanEventBitField.buildFirst(spanEventBo);
Assert.assertTrue(bitField.isSetAnnotation());
bitField.setAnnotation(false);
Assert.assertFalse(bitField.isSetAnnotation());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class RedisPluginTest method pipeline.
@Test
public void pipeline() {
JedisMock jedis = new JedisMock("localhost", 6379);
try {
Pipeline pipeline = jedis.pipelined();
pipeline.get("foo");
} finally {
if (jedis != null) {
jedis.close();
}
}
final List<SpanEventBo> events = getCurrentSpanEvents();
assertEquals(1, events.size());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class RedisPluginTest method binaryJedis.
@Test
public void binaryJedis() {
JedisMock jedis = new JedisMock("localhost", 6379);
try {
jedis.get("foo".getBytes());
} finally {
if (jedis != null) {
jedis.close();
}
}
final List<SpanEventBo> events = getCurrentSpanEvents();
assertEquals(1, events.size());
final SpanEventBo eventBo = events.get(0);
assertEquals(HOST + ":" + PORT, eventBo.getEndPoint());
assertEquals("REDIS", eventBo.getDestinationId());
}
use of com.navercorp.pinpoint.common.server.bo.SpanEventBo in project pinpoint by naver.
the class CorruptedSpanAlignFactory method get.
public SpanAlign get(final String title, final SpanBo span, final SpanEventBo spanEvent) {
final SpanEventBo missedEvent = new SpanEventBo();
// TODO use invalid event information ?
missedEvent.setStartElapsed(spanEvent.getStartElapsed());
missedEvent.setEndElapsed(spanEvent.getEndElapsed());
missedEvent.setServiceType(ServiceType.COLLECTOR.getCode());
List<AnnotationBo> annotations = new ArrayList<>();
ApiMetaDataBo apiMetaData = new ApiMetaDataBo();
apiMetaData.setLineNumber(-1);
apiMetaData.setApiInfo("...");
apiMetaData.setMethodTypeEnum(MethodTypeEnum.CORRUPTED);
final AnnotationBo apiMetaDataAnnotation = new AnnotationBo();
apiMetaDataAnnotation.setKey(AnnotationKey.API_METADATA.getCode());
apiMetaDataAnnotation.setValue(apiMetaData);
annotations.add(apiMetaDataAnnotation);
final AnnotationBo argumentAnnotation = new AnnotationBo();
argumentAnnotation.setKey(AnnotationKeyUtils.getArgs(0).getCode());
if (System.currentTimeMillis() - span.getStartTime() < timeoutMillisec) {
argumentAnnotation.setValue("Corrupted(waiting for packet) ");
} else {
if (title != null) {
argumentAnnotation.setValue("Corrupted(" + title + ")");
} else {
argumentAnnotation.setValue("Corrupted");
}
}
annotations.add(argumentAnnotation);
missedEvent.setAnnotationBoList(annotations);
return new SpanAlign(span, missedEvent);
}
Aggregations