Search in sources :

Example 86 with Event

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));
}
Also used : AttributeValue(org.hypertrace.core.datamodel.AttributeValue) HashMap(java.util.HashMap) Event(org.hypertrace.core.datamodel.Event) Test(org.junit.jupiter.api.Test)

Example 87 with Event

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));
}
Also used : Event(org.hypertrace.core.datamodel.Event) Test(org.junit.jupiter.api.Test)

Example 88 with Event

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;
}
Also used : Event(org.hypertrace.core.datamodel.Event)

Example 89 with 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;
}
Also used : Event(org.hypertrace.core.datamodel.Event)

Example 90 with 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;
}
Also used : Event(org.hypertrace.core.datamodel.Event)

Aggregations

Event (org.hypertrace.core.datamodel.Event)304 Test (org.junit.jupiter.api.Test)257 AttributeValue (org.hypertrace.core.datamodel.AttributeValue)54 StructuredTrace (org.hypertrace.core.datamodel.StructuredTrace)54 Attributes (org.hypertrace.core.datamodel.Attributes)41 Entity (org.hypertrace.entity.data.service.v1.Entity)27 HashMap (java.util.HashMap)25 AbstractAttributeEnricherTest (org.hypertrace.traceenricher.enrichment.enrichers.AbstractAttributeEnricherTest)17 ByteBuffer (java.nio.ByteBuffer)13 BackendInfo (org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo)13 StructuredTraceGraph (org.hypertrace.core.datamodel.shared.StructuredTraceGraph)12 TestUtil.buildAttributeValue (org.hypertrace.traceenricher.TestUtil.buildAttributeValue)11 AttributeMetadata (org.hypertrace.core.attribute.service.v1.AttributeMetadata)10 SemanticConventionTestUtil.buildAttributes (org.hypertrace.semantic.convention.utils.SemanticConventionTestUtil.buildAttributes)8 Edge (org.hypertrace.core.datamodel.Edge)7 Entity (org.hypertrace.core.datamodel.Entity)7 HashSet (java.util.HashSet)6 List (java.util.List)6 Map (java.util.Map)6 ArrayList (java.util.ArrayList)5