Ejemplo n.º 1
0
 public SpanTest()
 {
     timestamp          = Timestamp.FromDateTimeOffset(startTime);
     timestampConverter = Timer.StartNew(startTime, () => interval);
     spanContext        = SpanContext.Create(TraceId.GenerateRandomId(random), SpanId.GenerateRandomId(random), OpenTelemetry.Trace.TraceOptions.Default, Tracestate.Empty);
     parentSpanId       = SpanId.GenerateRandomId(random);
     attributes.Add(
         "MyStringAttributeKey", AttributeValue.StringAttributeValue("MyStringAttributeValue"));
     attributes.Add("MyLongAttributeKey", AttributeValue.LongAttributeValue(123L));
     attributes.Add("MyBooleanAttributeKey", AttributeValue.BooleanAttributeValue(false));
     expectedAttributes = new Dictionary <String, IAttributeValue>(attributes);
     expectedAttributes.Add(
         "MySingleStringAttributeKey",
         AttributeValue.StringAttributeValue("MySingleStringAttributeValue"));
 }
Ejemplo n.º 2
0
        //@Rule public readonly ExpectedException exception = ExpectedException.none();


        public SpanTest()
        {
            spanContext        = SpanContext.Create(TraceId.GenerateRandomId(random), SpanId.GenerateRandomId(random), TraceOptions.DEFAULT);
            parentSpanId       = SpanId.GenerateRandomId(random);
            testClock          = TestClock.Create(timestamp);
            timestampConverter = TimestampConverter.Now(testClock);
            attributes.Add(
                "MyStringAttributeKey", AttributeValue.StringAttributeValue("MyStringAttributeValue"));
            attributes.Add("MyLongAttributeKey", AttributeValue.LongAttributeValue(123L));
            attributes.Add("MyBooleanAttributeKey", AttributeValue.BooleanAttributeValue(false));
            expectedAttributes = new Dictionary <String, IAttributeValue>(attributes);
            expectedAttributes.Add(
                "MySingleStringAttributeKey",
                AttributeValue.StringAttributeValue("MySingleStringAttributeValue"));
        }
Ejemplo n.º 3
0
        public SpanDataTest()
        {
            spanContext  = SpanContext.Create(TraceId.GenerateRandomId(random), SpanId.GenerateRandomId(random), TraceOptions.Default, Tracestate.Empty);
            parentSpanId = SpanId.GenerateRandomId(random);

            attributesMap.Add("MyAttributeKey1", AttributeValue.LongAttributeValue(10));
            attributesMap.Add("MyAttributeKey2", AttributeValue.BooleanAttributeValue(true));
            attributes = Attributes.Create(attributesMap, 1);

            eventList.Add(TimedEvent <IEvent> .Create(eventTimestamp1, spanEvent));
            eventList.Add(TimedEvent <IEvent> .Create(eventTimestamp3, spanEvent));
            events = TimedEvents <IEvent> .Create(eventList, 2);

            linksList.Add(Link.FromSpanContext(spanContext, LinkType.ChildLinkedSpan));
            links = LinkList.Create(linksList, 0);
        }
Ejemplo n.º 4
0
        public SpanDataTest()
        {
            spanContext  = SpanContext.Create(TraceId.GenerateRandomId(random), SpanId.GenerateRandomId(random), TraceOptions.DEFAULT);
            parentSpanId = SpanId.GenerateRandomId(random);

            attributesMap.Add("MyAttributeKey1", AttributeValue.LongAttributeValue(10));
            attributesMap.Add("MyAttributeKey2", AttributeValue.BooleanAttributeValue(true));
            attributes = Attributes.Create(attributesMap, 1);

            annotationsList.Add(TimedEvent <IAnnotation> .Create(eventTimestamp1, annotation));
            annotationsList.Add(TimedEvent <IAnnotation> .Create(eventTimestamp3, annotation));
            annotations = TimedEvents <IAnnotation> .Create(annotationsList, 2);

            //networkEventsList.add(SpanData.TimedEvent.Create(eventTimestamp1, recvNetworkEvent));
            //networkEventsList.add(SpanData.TimedEvent.Create(eventTimestamp2, sentNetworkEvent));
            //networkEvents = TimedEvents.Create(networkEventsList, 3);

            messageEventsList.Add(TimedEvent <IMessageEvent> .Create(eventTimestamp1, recvMessageEvent));
            messageEventsList.Add(TimedEvent <IMessageEvent> .Create(eventTimestamp2, sentMessageEvent));
            messageEvents = TimedEvents <IMessageEvent> .Create(messageEventsList, 3);

            linksList.Add(Link.FromSpanContext(spanContext, LinkType.CHILD_LINKED_SPAN));
            links = LinkList.Create(linksList, 0);
        }