From 8c5c9806d7cab87eba899b8d83a4767abacc9873 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 25 Jul 2014 21:15:44 +0100 Subject: [PATCH] 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.:.requests (e.g. service.POST:/xinventory.requests) --- .../Servers/HttpServer/BaseRequestHandler.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs index bbac699d3e..72ffb0e64a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs @@ -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