use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class SpanTypeAttributeEnricherTest method test_getProtocolName_HttpFromFullUrl_shouldReturnHttp.
@Test
public void test_getProtocolName_HttpFromFullUrl_shouldReturnHttp() {
Map<String, AttributeValue> map = new HashMap<>();
map.put(Constants.getRawSpanConstant(Http.HTTP_METHOD), AttributeValue.newBuilder().setValue("GET").build());
Event e = createEvent(map, new HashMap<>());
e.setHttp(org.hypertrace.core.datamodel.eventfields.http.Http.newBuilder().setRequest(Request.newBuilder().setUrl("http://hypertrace.org").build()).build());
Assertions.assertEquals(Protocol.PROTOCOL_HTTP, SpanTypeAttributeEnricher.getProtocolName(e));
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class SpanTypeAttributeEnricherTest method test_getProtocolNameWithNonGrpcEventName_noOTandGrpcTags_shouldReturnUnknown.
@Test
public void test_getProtocolNameWithNonGrpcEventName_noOTandGrpcTags_shouldReturnUnknown() {
Event e = createEvent(new HashMap<>(), new HashMap<>());
e.setEventName("ingress");
Assertions.assertEquals(Protocol.PROTOCOL_UNSPECIFIED, SpanTypeAttributeEnricher.getProtocolName(e));
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class TestUtils method createEntryEventWithName.
public static Event createEntryEventWithName(String eventName) {
Event event = createEntryEvent();
event.setEventName(eventName);
return event;
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class TestUtils method createExitEventName.
public static Event createExitEventName(String eventName) {
Event event = createExitEvent();
event.setEventName(eventName);
return event;
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class TestUtils method createUnspecifiedTypeEventWithName.
public static Event createUnspecifiedTypeEventWithName(String eventName) {
Event event = createUnspecifiedTypeEvent();
event.setEventName(eventName);
return event;
}
Aggregations