Beispiel #1
0
        public override async Task ProcessResponseHeaders(string responseHeaders)
        {
            CountOfHeaderBytes += (ulong)responseHeaders.Length;
            ContentType         = WebDataPacketReader.GetContentTypeFromResponseHeaders(responseHeaders);

            var headers = WebDataPacketReader.GetHeaders(responseHeaders);

            if (headers.ContainsKey("content-encoding"))
            {
                Increment(ContentEncoding, headers["content-encoding"].ToLower());
            }
            else
            {
                Increment(ContentEncoding, "(not specified)");
            }

            if (headers.ContainsKey("content-language"))
            {
                Increment(ContentLanguage, headers["content-language"].ToLower());
            }
            else
            {
                Increment(ContentLanguage, "(not specified)");
            }
        }
Beispiel #2
0
        public override async Task ProcessRequest(string request)
        {
            CurrentUri = WebDataPacketReader.GetUriFromRequestString(request);

            ResourceCount++;
            CountOfRequestBytes += (ulong)request.Length;

            if (CurrentUri == null)
            {
                return;
            }

            var domain = domainParser.Get(CurrentUri?.Host);

            Increment(TLDCounts, domain == null ? "(blank)" : domain.TLD);
            Increment(HostCounts, CurrentUri?.Host);

            var headers = WebDataPacketReader.GetHeaders(request);

            if (headers.ContainsKey("responsetime"))
            {
                ResponseTimeMilliseconds += TimeSpan.Parse(headers["responsetime"]).TotalMilliseconds;
            }
        }