From 231a3bf147315a9284140476d2b09e13c3fee1c0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 3 May 2012 01:45:49 +0100 Subject: Implement optional name and description on http stream handlers so that we can relate a slow request to what the handler actually does and the agent it serves, if applicable. This is most useful for capabilities where the url is not self-describing. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 0fbf90a..4ea4a1a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer } } - public List GetStreamHandlerKeys() + public List GetStreamHandlerKeys() { lock (m_streamHandlers) return new List(m_streamHandlers.Keys); @@ -410,6 +410,8 @@ namespace OpenSim.Framework.Servers.HttpServer // string reqnum = "unknown"; int tickstart = Environment.TickCount; + IRequestHandler requestHandler = null; + try { // OpenSim.Framework.WebUtil.OSHeaderRequestID @@ -438,8 +440,6 @@ namespace OpenSim.Framework.Servers.HttpServer //response.KeepAlive = true; response.SendChunked = false; - IRequestHandler requestHandler; - string path = request.RawUrl; string handlerKey = GetHandlerKey(request.HttpMethod, path); @@ -675,8 +675,16 @@ namespace OpenSim.Framework.Servers.HttpServer // since its just for reporting, tickdiff limit can be adjusted int tickdiff = Environment.TickCount - tickstart; if (tickdiff > 3000) + { m_log.InfoFormat( - "[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff); + "[BASE HTTP SERVER]: slow {0} for {1} {2} {3} from {4} took {5} ms", + requestMethod, + uriString, + requestHandler != null ? requestHandler.Name : "", + requestHandler != null ? requestHandler.Description : "", + request.RemoteIPEndPoint.ToString(), + tickdiff); + } } } -- cgit v1.1 From fb99ee67743dddd75c2b65039f227188f46cc389 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 4 May 2012 01:16:56 +0100 Subject: minor: Tweak BaseHttpServer message to make it clear that this relates to slow handling of inbound requests. --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 4ea4a1a..6fa36b5 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -677,7 +677,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (tickdiff > 3000) { m_log.InfoFormat( - "[BASE HTTP SERVER]: slow {0} for {1} {2} {3} from {4} took {5} ms", + "[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms", requestMethod, uriString, requestHandler != null ? requestHandler.Name : "", -- cgit v1.1