aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
diff options
context:
space:
mode:
authorMic Bowman2011-01-05 14:32:00 -0800
committerMic Bowman2011-01-05 14:32:00 -0800
commit984a9b408534d42f18bd072f70f9e2b31a691f9f (patch)
tree744cf6daa420a2aa4446200b5012b7237ee7ffaf /OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
parentremoved the early return on agentupdates, this was debugging code (diff)
downloadopensim-SC-984a9b408534d42f18bd072f70f9e2b31a691f9f.zip
opensim-SC-984a9b408534d42f18bd072f70f9e2b31a691f9f.tar.gz
opensim-SC-984a9b408534d42f18bd072f70f9e2b31a691f9f.tar.bz2
opensim-SC-984a9b408534d42f18bd072f70f9e2b31a691f9f.tar.xz
Added more performance checks to the HTTP server. Each request
coming through the WebUtil fns has a request id in the header that can match the request to the actual work done by the service
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 3343f60..86ad7aa 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -346,9 +346,15 @@ namespace OpenSim.Framework.Servers.HttpServer
346 /// <param name="response"></param> 346 /// <param name="response"></param>
347 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) 347 public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response)
348 { 348 {
349 string reqnum = "unknown";
350 int tickstart = Environment.TickCount;
351
349 try 352 try
350 { 353 {
351 //m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); 354 // OpenSim.Framework.WebUtil.OSHeaderRequestID
355 if (request.Headers["opensim-request-id"] != null)
356 reqnum = String.Format("{0}:{1}",request.RemoteIPEndPoint,request.Headers["opensim-request-id"]);
357 // m_log.DebugFormat("[BASE HTTP SERVER]: <{0}> handle request for {1}",reqnum,request.RawUrl);
352 358
353 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); 359 Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
354 360
@@ -576,6 +582,14 @@ namespace OpenSim.Framework.Servers.HttpServer
576 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); 582 m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e);
577 SendHTML500(response); 583 SendHTML500(response);
578 } 584 }
585 finally
586 {
587 // Every month or so this will wrap and give bad numbers, not really a problem
588 // since its just for reporting, 200ms limit can be adjusted
589 int tickdiff = Environment.TickCount - tickstart;
590 if (tickdiff > 200)
591 m_log.InfoFormat("[BASE HTTP SERVER]: slow request <{0}> for {1} took {2} ms",reqnum,request.RawUrl,tickdiff);
592 }
579 } 593 }
580 594
581 private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler) 595 private bool TryGetStreamHandler(string handlerKey, out IRequestHandler streamHandler)