use of com.navercorp.pinpoint.common.trace.AnnotationKey in project pinpoint by naver.
the class RecordFactory method getAnnotations.
public List<Record> getAnnotations(final int depth, final int parentId, SpanAlign align) {
List<Record> list = new ArrayList<>();
for (AnnotationBo annotation : align.getAnnotationBoList()) {
final AnnotationKey key = findAnnotationKey(annotation.getKey());
if (key.isViewInRecordSet()) {
final Record record = new Record(depth, getNextId(), parentId, false, key.getName(), annotation.getValue().toString(), 0L, 0L, 0, null, null, null, null, false, false, null, 0, 0, MethodTypeEnum.DEFAULT, annotation.isAuthorized());
list.add(record);
}
}
return list;
}
use of com.navercorp.pinpoint.common.trace.AnnotationKey in project pinpoint by naver.
the class RecordFactory method getApi.
private Api getApi(final SpanAlign align) {
final AnnotationBo annotation = AnnotationUtils.findAnnotationBo(align.getAnnotationBoList(), AnnotationKey.API_METADATA);
if (annotation != null) {
final Api api = new Api();
final ApiMetaDataBo apiMetaData = (ApiMetaDataBo) annotation.getValue();
String apiInfo = getApiInfo(apiMetaData);
api.setTitle(apiInfo);
api.setDescription(apiInfo);
if (apiMetaData.getMethodTypeEnum() == MethodTypeEnum.DEFAULT) {
try {
ApiDescription apiDescription = apiDescriptionParser.parse(api.description);
api.setTitle(apiDescription.getSimpleMethodDescription());
api.setClassName(apiDescription.getSimpleClassName());
} catch (Exception e) {
logger.debug("Failed to api parse. {}", api.description, e);
}
}
api.setMethodTypeEnum(apiMetaData.getMethodTypeEnum());
return api;
} else {
final Api api = new Api();
AnnotationKey apiMetaDataError = getApiMetaDataError(align.getAnnotationBoList());
api.setTitle(apiMetaDataError.getName());
return api;
}
}
use of com.navercorp.pinpoint.common.trace.AnnotationKey in project pinpoint by naver.
the class AnnotationKeyTest method testValueOf.
@Test
public void testValueOf() {
AnnotationKeyRegistryService annotationKeyRegistryService = new DefaultAnnotationKeyRegistryService();
annotationKeyRegistryService.findAnnotationKeyByName(AnnotationKey.ARGS0.getName());
AnnotationKey valueof = annotationKeyRegistryService.findAnnotationKeyByName(AnnotationKey.ARGS0.getName());
Assert.assertSame(AnnotationKey.ARGS0, valueof);
}
use of com.navercorp.pinpoint.common.trace.AnnotationKey in project pinpoint by naver.
the class ServiceTypeInitializerTest method testDuplicated3.
@Test(expected = RuntimeException.class)
public void testDuplicated3() {
List<TraceMetadataProvider> providers = Arrays.<TraceMetadataProvider>asList(new TestProvider(TEST_TYPES, TEST_KEYS), new TestProvider(TEST_TYPES, new AnnotationKey[0]));
TraceMetadataLoader loader = new TraceMetadataLoader();
loader.load(providers);
}
use of com.navercorp.pinpoint.common.trace.AnnotationKey in project pinpoint by naver.
the class ServiceTypeInitializerTest method testDuplicated2.
@Test(expected = RuntimeException.class)
public void testDuplicated2() {
List<TraceMetadataProvider> providers = Arrays.<TraceMetadataProvider>asList(new TestProvider(TEST_TYPES, TEST_KEYS), new TestProvider(TEST_TYPES, new AnnotationKey[0]));
TraceMetadataLoader loader = new TraceMetadataLoader();
loader.load(providers);
}
Aggregations