Exemple #1
0
 public void Remove(HttpTransportItem dto)
 {
     lock (_mutex)
     {
         this.List.Remove(dto);
     }
 }
        public void HandleMessage(WebMessageTrace messageTrace)
        {
            var httpTransportDto = new HttpTransportItem { Id = messageTrace.Id, Server = messageTrace.Server };

            var message = messageTrace.Messages.FirstOrDefault(x => x.Type == WebMessageType.Request);
            {
                httpTransportDto.RequestData = MaskPassword(message);
                httpTransportDto.RequestHeader = new HttpTransportRequestHeader(message.Headers);
                httpTransportDto.RequestTimestamp = message.Timestamp;
                httpTransportDto.Method = message.Method;
                httpTransportDto.RequestUri = message.AbsolutePath;
            }

            message = messageTrace.Messages.FirstOrDefault(x => x.Type == WebMessageType.Response);
            if (message != null)
            {
                httpTransportDto.ResponseData = message.Details;
                httpTransportDto.ResponseHeader = new HttpTransportResponseHeader(message.Headers);
                TimeSpan span = message.Timestamp.Subtract(httpTransportDto.RequestTimestamp);
                httpTransportDto.TimeTaken = string.Format("{0}:{1}:{2}.{3}", span.Hours, span.Minutes, span.Seconds, span.Milliseconds);
            }

            message = messageTrace.Messages.FirstOrDefault(x => x.Type == WebMessageType.Error);
            if (message != null)
            {
                httpTransportDto.Error = message.Details;
                httpTransportDto.ResponseHeader = new HttpTransportResponseHeader(message.Headers);
                TimeSpan span = message.Timestamp.Subtract(httpTransportDto.RequestTimestamp);
                httpTransportDto.TimeTaken = string.Format("{0}:{1}:{2}.{3}", span.Hours, span.Minutes, span.Seconds, span.Milliseconds);
            }
            cachedCollection.Add(httpTransportDto);
        }
Exemple #3
0
 public void Add(HttpTransportItem dto)
 {
     lock (_mutex)
     {
         if (this.List.Count >= _capacity)
         {
             this.List.RemoveAt(0);
         }
         this.List.Add(dto);
     }
 }
 public void Remove(HttpTransportItem dto)
 {
     lock (_mutex)
     {
         this.List.Remove(dto);
     }
 }
 public void Add(HttpTransportItem dto)
 {
     lock (_mutex)
     {
         if (this.List.Count >= _capacity)
             this.List.RemoveAt(0);
         this.List.Add(dto);
     }
 }