Add stats for service endpoints using existing data.

For each service endpoint (e.g. posts to the xinventory service), a stat is available which shows the number of requests received and moving average per second
The full name is "service.<http-method>:<path>.requests (e.g. service.POST:/xinventory.requests)
0.8.0.3
Justin Clark-Casey (justincc) 2014-07-25 21:15:44 +01:00 committed by Justin Clark-Casey
parent 26916806db
commit 2f7d950ead
1 changed files with 14 additions and 0 deletions

View File

@ -26,6 +26,7 @@
*/
using System;
using OpenSim.Framework.Monitoring;
namespace OpenSim.Framework.Servers.HttpServer
{
@ -61,6 +62,19 @@ namespace OpenSim.Framework.Servers.HttpServer
Description = description;
m_httpMethod = httpMethod;
m_path = path;
StatsManager.RegisterStat(
new Stat(
"requests",
"requests",
"Number of requests received by this service endpoint",
"requests",
"service",
string.Format("{0}:{1}", httpMethod, path),
StatType.Pull,
MeasuresOfInterest.AverageChangeOverTime,
s => s.Value = RequestsReceived,
StatVerbosity.Debug));
}
public virtual string Path