Пример #1
0
 private void Complete(MeasurementEventStatus status, DateTime endTime, TimeSpan duration, TimeSpan processingTime, bool disposing)
 {
     if (this.completed && !disposing)
     {
         throw new InvalidOperationException("Event.Complete called twice on the same event instance.");
     }
     if (this.disposed)
     {
         throw new ObjectDisposedException(typeof(TEvent).FullName);
     }
     this.completedStatus         = status;
     this.completed               = true;
     this.completedDuration       = (duration < TimeSpan.Zero ? TimeSpan.Zero : duration);
     this.completedProcessingTime = (processingTime < TimeSpan.Zero ? TimeSpan.Zero : processingTime);
     if (!this.completeOnlyOnDisposal || disposing)
     {
         MeasurementEventBindingGroup.RecordEvent <TEvent>(this.Metadata.EventProducer, (TEvent)this, endTime);
     }
 }
Пример #2
0
 public void Complete(MeasurementEventStatus status, TimeSpan duration, TimeSpan processingTime)
 {
     this.Complete(status, DateTime.UtcNow, duration, processingTime, false);
 }
Пример #3
0
        public void Complete(MeasurementEventStatus status)
        {
            DateTime utcNow = DateTime.UtcNow;

            this.Complete(status, utcNow, utcNow - this.startTime, utcNow - this.startTime, false);
        }
Пример #4
0
 public void Complete(MeasurementEventStatus status, TimeSpan duration)
 {
     this.Complete(status, DateTime.UtcNow, duration, DateTime.UtcNow - this.startTime, false);
 }
Пример #5
0
 static MeasurementEventStatus()
 {
     MeasurementEventStatus.UnknownFailure = new MeasurementEventStatus("UnknownFailure");
 }