diff options
author | Justin Clark-Casey (justincc) | 2014-03-18 23:47:33 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-03-18 23:47:33 +0000 |
commit | fad1d70180cda75a1a36aeb8223e9d8f04ae6113 (patch) | |
tree | 367878b2c4511c284c6473a8803d4d58ddf5b528 /OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | |
parent | minor: Correction to description of QueuedPollResponses since this covers lon... (diff) | |
download | opensim-SC_OLD-fad1d70180cda75a1a36aeb8223e9d8f04ae6113.zip opensim-SC_OLD-fad1d70180cda75a1a36aeb8223e9d8f04ae6113.tar.gz opensim-SC_OLD-fad1d70180cda75a1a36aeb8223e9d8f04ae6113.tar.bz2 opensim-SC_OLD-fad1d70180cda75a1a36aeb8223e9d8f04ae6113.tar.xz |
Add httpserver.<port>.QueuedPollResponses and httpserver.<port>.ProcessedPollResponses statistics
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 26 |
1 files changed, 24 insertions, 2 deletions
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 | |||
58 | /// </summary> | 58 | /// </summary> |
59 | public bool PerformResponsesAsync { get; private set; } | 59 | public bool PerformResponsesAsync { get; private set; } |
60 | 60 | ||
61 | /// <summary> | ||
62 | /// Number of responses actually processed and sent to viewer (or aborted due to error). | ||
63 | /// </summary> | ||
64 | public int ResponsesProcessed { get; private set; } | ||
65 | |||
61 | private readonly BaseHttpServer m_server; | 66 | private readonly BaseHttpServer m_server; |
62 | 67 | ||
63 | private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); | 68 | private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>(); |
@@ -81,14 +86,27 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
81 | StatsManager.RegisterStat( | 86 | StatsManager.RegisterStat( |
82 | new Stat( | 87 | new Stat( |
83 | "QueuedPollResponses", | 88 | "QueuedPollResponses", |
84 | "Number of poll responses queued for sending.", | 89 | "Number of poll responses queued for processing.", |
90 | "", | ||
91 | "", | ||
92 | "httpserver", | ||
93 | m_server.Port.ToString(), | ||
94 | StatType.Pull, | ||
95 | MeasuresOfInterest.AverageChangeOverTime, | ||
96 | stat => stat.Value = m_requests.Count(), | ||
97 | StatVerbosity.Debug)); | ||
98 | |||
99 | StatsManager.RegisterStat( | ||
100 | new Stat( | ||
101 | "ProcessedPollResponses", | ||
102 | "Number of poll responses processed.", | ||
85 | "", | 103 | "", |
86 | "", | 104 | "", |
87 | "httpserver", | 105 | "httpserver", |
88 | m_server.Port.ToString(), | 106 | m_server.Port.ToString(), |
89 | StatType.Pull, | 107 | StatType.Pull, |
90 | MeasuresOfInterest.AverageChangeOverTime, | 108 | MeasuresOfInterest.AverageChangeOverTime, |
91 | stat => m_requests.Count(), | 109 | stat => stat.Value = ResponsesProcessed, |
92 | StatVerbosity.Debug)); | 110 | StatVerbosity.Debug)); |
93 | } | 111 | } |
94 | 112 | ||
@@ -210,6 +228,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
210 | try | 228 | try |
211 | { | 229 | { |
212 | wreq = m_requests.Dequeue(0); | 230 | wreq = m_requests.Dequeue(0); |
231 | ResponsesProcessed++; | ||
213 | wreq.DoHTTPGruntWork( | 232 | wreq.DoHTTPGruntWork( |
214 | m_server, wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); | 233 | m_server, wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id)); |
215 | } | 234 | } |
@@ -256,6 +275,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
256 | { | 275 | { |
257 | try | 276 | try |
258 | { | 277 | { |
278 | ResponsesProcessed++; | ||
259 | req.DoHTTPGruntWork(m_server, responsedata); | 279 | req.DoHTTPGruntWork(m_server, responsedata); |
260 | } | 280 | } |
261 | catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream | 281 | catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream |
@@ -270,6 +290,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
270 | { | 290 | { |
271 | try | 291 | try |
272 | { | 292 | { |
293 | ResponsesProcessed++; | ||
273 | req.DoHTTPGruntWork(m_server, responsedata); | 294 | req.DoHTTPGruntWork(m_server, responsedata); |
274 | } | 295 | } |
275 | catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream | 296 | catch (ObjectDisposedException e) // Browser aborted before we could read body, server closed the stream |
@@ -290,6 +311,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
290 | { | 311 | { |
291 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) | 312 | if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) |
292 | { | 313 | { |
314 | ResponsesProcessed++; | ||
293 | req.DoHTTPGruntWork( | 315 | req.DoHTTPGruntWork( |
294 | m_server, req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); | 316 | m_server, req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id)); |
295 | } | 317 | } |