Exemplo n.º 1
0
        // Returns the SpanId of the newly-created Span in the EventTracer
        public SpanId AddSpan(SpanId[] causes)
        {
            unsafe
            {
                if (causes == null)
                {
                    return(AddSpan());
                }

                var causeIds = new CEventTrace.SpanId[causes.Length];
                for (var i = 0; i < causes.Length; i++)
                {
                    causeIds[i] = ParameterConversion.ConvertSpanId(causes[i]);
                }

                CEventTrace.SpanId createdSpanId;
                fixed(CEventTrace.SpanId *fixedCauseIds = causeIds)
                {
                    createdSpanId = CEventTrace.EventTracerAddSpan(eventTracer, fixedCauseIds, (uint)causeIds.Length);
                }

                var newSpanId = new SpanId();
                ApiInterop.Memcpy(newSpanId.Data, createdSpanId.Data, SpanId.SpanIdSize);

                return(newSpanId);
            }
        }
Exemplo n.º 2
0
        public SpanId AddSpan(SpanId spanId)
        {
            var newSpanId = new SpanId();

            unsafe
            {
                var internalSpanId = ParameterConversion.ConvertSpanId(spanId);
                var createdSpanId  = CEventTrace.EventTracerAddSpan(eventTracer, &internalSpanId, 1);
                ApiInterop.Memcpy(newSpanId.Data, createdSpanId.Data, SpanId.SpanIdSize);
            }

            return(newSpanId);
        }
Exemplo n.º 3
0
 public override int GetHashCode()
 {
     return(CEventTrace.SpanIdHash(ParameterConversion.ConvertSpanId(this)));
 }
Exemplo n.º 4
0
 public void SetActiveSpanId(SpanId spanId)
 {
     CEventTrace.EventTracerSetActiveSpanId(eventTracer, ParameterConversion.ConvertSpanId(spanId));
 }
Exemplo n.º 5
0
 public bool Equals(SpanId other)
 {
     return(CEventTrace.SpanIdEqual(
                ParameterConversion.ConvertSpanId(this),
                ParameterConversion.ConvertSpanId(other)) > 0);
 }