protected override void WireUp(DurationProbe probe)
    {
        context.Pipeline.OnReceivePipelineCompleted((e, _) =>
        {
            e.TryGetMessageType(out var messageTypeProcessed);

            var processingTime = e.CompletedAt - e.StartedAt;

            var @event = new DurationEvent(processingTime, messageTypeProcessed);

            probe.Record(ref @event);

            return(TaskExtensions.Completed);
        });
    }
    protected override void WireUp(DurationProbe probe)
    {
        context.Pipeline.OnReceivePipelineCompleted((e, _) =>
        {
            if (e.TryGetDeliverAt(out DateTimeOffset startTime) || e.TryGetTimeSent(out startTime))
            {
                var endToEndTime = e.CompletedAt - startTime;
                e.TryGetMessageType(out var messageType);

                var @event = new DurationEvent(endToEndTime, messageType);
                probe.Record(ref @event);
            }

            return(TaskExtensions.Completed);
        });
    }
Exemple #3
0
 static void Empty(ref DurationEvent e)
 {
 }
Exemple #4
0
 internal void Record(ref DurationEvent e)
 {
     observers(ref e);
 }
 public GeneratedEvent(DurationEvent execEvent, float time)
 {
     this.execEvent = execEvent;
     this.time      = time;
 }