Esempio n. 1
0
        private ImmutableTransaction BuildTestTransaction(List <Segment> segments, bool sampled, bool hasIncomingPayload)
        {
            var builder = new ImmutableTransactionBuilder()
                          .IsWebTransaction("foo", "bar")
                          .WithPriority(Priority)
                          .WithDistributedTracing(DistributedTraceGuid, DistributedTraceTraceId, sampled, hasIncomingPayload)
                          .WithSegments(segments)
                          .WithStartTime(_startTime)
                          .WithTransactionGuid(_transactionGuid);

            var segmentWithError = segments.FirstOrDefault(s => s.ErrorData != null);

            if (segmentWithError != null)
            {
                builder.WithExceptionFromSegment(segmentWithError);
            }

            return(builder.Build());
        }