Exemple #1
0
 public TimelineScope_(ITimelineScope timelineScope)
 {
     EventType = timelineScope.EventType;
     Duration  = timelineScope.Duration;
     Children  = timelineScope.Children;
     Name      = timelineScope.Name;
     Category  = timelineScope.Category;
     Data      = timelineScope.Data;
     Timestamp = timelineScope.Timestamp;
 }
Exemple #2
0
        private async Task <HttpRequestRecord> PreprocessAsync(HttpContext context, RinOptions options, ITimelineScope timelineRoot)
        {
            var request  = context.Request;
            var response = context.Response;

            var record = new HttpRequestRecord()
            {
                Id                = Guid.NewGuid().ToString(),
                IsHttps           = request.IsHttps,
                Host              = request.Host,
                QueryString       = request.QueryString,
                Path              = request.Path,
                Method            = request.Method,
                RequestReceivedAt = DateTimeOffset.Now,
                RequestHeaders    = request.Headers.ToDictionary(k => k.Key, v => v.Value),
                RemoteIpAddress   = request.HttpContext.Connection.RemoteIpAddress,
                Timeline          = timelineRoot,
            };

            // Set Rin recorder feature.
            context.Features.Set <IRinRequestRecordingFeature>(new RinRequestRecordingFeature(record));

            await _eventBus.PostAsync(new RequestEventMessage(EventSourceName, record, RequestEvent.BeginRequest));

            // Set a current Rin request ID to response header.
            context.Response.Headers.Add("X-Rin-Request-Id", record.Id);

            if (options.RequestRecorder.EnableBodyCapturing)
            {
                context.EnableResponseDataCapturing();
                request.EnableBuffering();
            }
            response.OnStarting(OnStarting, record);
            response.OnCompleted(OnCompleted, record);

            // Execute pipeline middlewares.
            record.Processing = TimelineScope.Create("Processing", TimelineEventCategory.AspNetCoreCommon);

            return(record);
        }
Exemple #3
0
 internal FlowRouter(FlowType flow, ITimelineScope timeline)
 {
     _flow     = flow;
     _timeline = timeline;
 }
Exemple #4
0
 internal TimelineFlowSet(ITimelineScope scope)
 {
     _scope = scope;
 }
 internal TimelineRequestSet(ITimelineScope scope)
 {
     _scope = scope;
 }
Exemple #6
0
 public Timeline(ITimelineDb db, ITimelineScope scope)
 {
     _db    = db;
     _scope = scope;
 }