From fad1d70180cda75a1a36aeb8223e9d8f04ae6113 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Mar 2014 23:47:33 +0000 Subject: Add httpserver..QueuedPollResponses and httpserver..ProcessedPollResponses statistics --- .../HttpServer/PollServiceRequestManager.cs | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index b676bee..4561d23 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -58,6 +58,11 @@ namespace OpenSim.Framework.Servers.HttpServer /// public bool PerformResponsesAsync { get; private set; } + /// + /// Number of responses actually processed and sent to viewer (or aborted due to error). + /// + public int ResponsesProcessed { get; private set; } + private readonly BaseHttpServer m_server; private BlockingQueue m_requests = new BlockingQueue(); @@ -81,14 +86,27 @@ namespace OpenSim.Framework.Servers.HttpServer StatsManager.RegisterStat( new Stat( "QueuedPollResponses", - "Number of poll responses queued for sending.", + "Number of poll responses queued for processing.", + "", + "", + "httpserver", + m_server.Port.ToString(), + StatType.Pull, + MeasuresOfInterest.AverageChangeOverTime, + stat => stat.Value = m_requests.Count(), + StatVerbosity.Debug)); + + StatsManager.RegisterStat( + new Stat( + "ProcessedPollResponses", + "Number of poll responses processed.", "", "", "httpserver", m_server.Port.ToString(), StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, - stat => m_requests.Count(), + stat => stat.Value = ResponsesProcessed, StatVerbosity.Debug)); } @@ -210,6 +228,7 @@ namespace OpenSim.Framework.Servers.HttpServer try { wreq = m_requests.Dequeue(0); + ResponsesProcessed++; wreq.DoHTTPGruntWork( m_server, wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); } @@ -256,6 +275,7 @@ namespace OpenSim.Framework.Servers.HttpServer { try { + ResponsesProcessed++; req.DoHTTPGruntWork(m_server, responsedata); } catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream @@ -270,6 +290,7 @@ namespace OpenSim.Framework.Servers.HttpServer { try { + ResponsesProcessed++; req.DoHTTPGruntWork(m_server, responsedata); } catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream @@ -290,6 +311,7 @@ namespace OpenSim.Framework.Servers.HttpServer { if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) { + ResponsesProcessed++; req.DoHTTPGruntWork( m_server, req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); } -- cgit v1.1