From 327632dc66981c4271ca80c7aa62f934e2371162 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 26 Jul 2014 02:17:04 +0100 Subject: [PATCH] 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.) --- .../Inventory/XInventoryServicesConnector.cs | 21 +++++++++++++++++++ prebuild.xml | 1 + 2 files changed, 22 insertions(+) diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index b9147379f5..93f9d48041 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; /// @@ -93,6 +99,19 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI; m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); + + 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) @@ -512,6 +531,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", diff --git a/prebuild.xml b/prebuild.xml index aef5722e0c..be77950a1f 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -823,6 +823,7 @@ +