示例#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);
            }
        }
示例#2
0
        public SpanId AddSpan()
        {
            var newSpanId = new SpanId();

            unsafe
            {
                var createdSpanId = CEventTrace.EventTracerAddSpan(eventTracer, null, 0);
                ApiInterop.Memcpy(newSpanId.Data, createdSpanId.Data, SpanId.SpanIdSize);
            }

            return(newSpanId);
        }
示例#3
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);
        }