예제 #1
0
        public void LogMessageProcessed(ComplianceMessage message)
        {
            message.ProtocolContext.ProcessEndTime = new DateTime?(DateTime.UtcNow);
            IPerformanceCounterAccessor counter = this.GetCounter(message.ComplianceMessageType.ToString());

            if (counter != null)
            {
                long latency = 0L;
                if (message.ProtocolContext.ProcessStartTime != null && message.ProtocolContext.ProcessEndTime != null)
                {
                    latency = (long)(message.ProtocolContext.ProcessEndTime.Value - message.ProtocolContext.ProcessStartTime.Value).TotalMilliseconds;
                }
                counter.AddProcessorEvent(ProcessorEvent.EndProcessing);
                counter.AddProcessingCompletionEvent(ExceptionHandler.IsFaulted(message) ? ProcessingCompletionEvent.Failure : ProcessingCompletionEvent.Success, latency);
            }
            if (message.ProtocolContext.Direction == ProtocolContext.MessageDirection.Return)
            {
                ProtocolContext.MessageDirection direction = message.ProtocolContext.Direction;
            }
        }
예제 #2
0
 public void LogMessageDispatched(ComplianceMessage message)
 {
     message.ProtocolContext.DispatchEndTime = new DateTime?(DateTime.UtcNow);
     ProtocolContext.MessageDirection direction = message.ProtocolContext.Direction;
 }