Add inventory.<url>.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.cs0.8.0.3
parent
95f3a9452d
commit
05dfc38f66
|
@ -34,6 +34,7 @@ using Nini.Config;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Monitoring;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using OpenSim.Server.Base;
|
using OpenSim.Server.Base;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
@ -46,6 +47,11 @@ namespace OpenSim.Services.Connectors
|
||||||
LogManager.GetLogger(
|
LogManager.GetLogger(
|
||||||
MethodBase.GetCurrentMethod().DeclaringType);
|
MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of requests made to the remote inventory service.
|
||||||
|
/// </summary>
|
||||||
|
public int RequestsMade { get; private set; }
|
||||||
|
|
||||||
private string m_ServerURI = String.Empty;
|
private string m_ServerURI = String.Empty;
|
||||||
|
|
||||||
private object m_Lock = new object();
|
private object m_Lock = new object();
|
||||||
|
@ -83,6 +89,19 @@ namespace OpenSim.Services.Connectors
|
||||||
throw new Exception("Inventory connector init error");
|
throw new Exception("Inventory connector init error");
|
||||||
}
|
}
|
||||||
m_ServerURI = serviceURI;
|
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<string, object> ret)
|
private bool CheckReturn(Dictionary<string, object> ret)
|
||||||
|
@ -502,6 +521,8 @@ namespace OpenSim.Services.Connectors
|
||||||
foreach (KeyValuePair<string, object> kvp in temp)
|
foreach (KeyValuePair<string, object> kvp in temp)
|
||||||
sendData.Add(kvp.Key, kvp.Value);
|
sendData.Add(kvp.Key, kvp.Value);
|
||||||
|
|
||||||
|
RequestsMade++;
|
||||||
|
|
||||||
string reply = string.Empty;
|
string reply = string.Empty;
|
||||||
lock (m_Lock)
|
lock (m_Lock)
|
||||||
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
||||||
|
|
|
@ -823,6 +823,7 @@
|
||||||
<Reference name="OpenSim.Capabilities"/>
|
<Reference name="OpenSim.Capabilities"/>
|
||||||
<Reference name="OpenSim.Framework.Communications"/>
|
<Reference name="OpenSim.Framework.Communications"/>
|
||||||
<Reference name="OpenSim.Framework.Console"/>
|
<Reference name="OpenSim.Framework.Console"/>
|
||||||
|
<Reference name="OpenSim.Framework.Monitoring"/>
|
||||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Server.Base"/>
|
<Reference name="OpenSim.Server.Base"/>
|
||||||
|
|
Loading…
Reference in New Issue