From 05dfc38f66c0db58acdec8e427c33b20034ec444 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 26 Jul 2014 02:17:04 +0100 Subject: Add inventory..RequestsMade stat. This gives a count of all requests made to the remote inventory service. This is finer grained than inventory.httpfetch.ProcessedFetchInventoryRequests since such a request can be comprised of many individual inv service calls. In addition, this will count requests that don't go through the HTTP inventory fetch (e.g. HG, archiving, etc.) Conflicts: OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs --- .../Inventory/XInventoryServicesConnector.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index f86d2f1..fd309a0 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs @@ -34,6 +34,7 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Framework.Communications; +using OpenSim.Framework.Monitoring; using OpenSim.Services.Interfaces; using OpenSim.Server.Base; using OpenMetaverse; @@ -46,6 +47,11 @@ namespace OpenSim.Services.Connectors LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Number of requests made to the remote inventory service. + /// + public int RequestsMade { get; private set; } + private string m_ServerURI = String.Empty; private object m_Lock = new object(); @@ -83,6 +89,19 @@ namespace OpenSim.Services.Connectors throw new Exception("Inventory connector init error"); } m_ServerURI = serviceURI; + + StatsManager.RegisterStat( + new Stat( + "RequestsMade", + "Requests made", + "Number of requests made to the remove inventory service", + "requests", + "inventory", + serviceURI, + StatType.Pull, + MeasuresOfInterest.AverageChangeOverTime, + s => s.Value = RequestsMade, + StatVerbosity.Debug)); } private bool CheckReturn(Dictionary ret) @@ -502,6 +521,8 @@ namespace OpenSim.Services.Connectors foreach (KeyValuePair kvp in temp) sendData.Add(kvp.Key, kvp.Value); + RequestsMade++; + string reply = string.Empty; lock (m_Lock) reply = SynchronousRestFormsRequester.MakeRequest("POST", -- cgit v1.1