diff options
author | Justin Clark-Casey (justincc) | 2014-07-26 02:17:04 +0100 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:58:23 +0100 |
commit | 05dfc38f66c0db58acdec8e427c33b20034ec444 (patch) | |
tree | 7735fb2c108c64c09c993643f90b4380f7f9192f /OpenSim | |
parent | Fix issue with TestTextureNotFound in previous commit 1e3027a (diff) | |
download | opensim-SC_OLD-05dfc38f66c0db58acdec8e427c33b20034ec444.zip opensim-SC_OLD-05dfc38f66c0db58acdec8e427c33b20034ec444.tar.gz opensim-SC_OLD-05dfc38f66c0db58acdec8e427c33b20034ec444.tar.bz2 opensim-SC_OLD-05dfc38f66c0db58acdec8e427c33b20034ec444.tar.xz |
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.cs
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | 21 |
1 files changed, 21 insertions, 0 deletions
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; | |||
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
37 | using OpenSim.Framework.Monitoring; | ||
37 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
38 | using OpenSim.Server.Base; | 39 | using OpenSim.Server.Base; |
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
@@ -46,6 +47,11 @@ namespace OpenSim.Services.Connectors | |||
46 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
47 | MethodBase.GetCurrentMethod().DeclaringType); | 48 | MethodBase.GetCurrentMethod().DeclaringType); |
48 | 49 | ||
50 | /// <summary> | ||
51 | /// Number of requests made to the remote inventory service. | ||
52 | /// </summary> | ||
53 | public int RequestsMade { get; private set; } | ||
54 | |||
49 | private string m_ServerURI = String.Empty; | 55 | private string m_ServerURI = String.Empty; |
50 | 56 | ||
51 | private object m_Lock = new object(); | 57 | private object m_Lock = new object(); |
@@ -83,6 +89,19 @@ namespace OpenSim.Services.Connectors | |||
83 | throw new Exception("Inventory connector init error"); | 89 | throw new Exception("Inventory connector init error"); |
84 | } | 90 | } |
85 | m_ServerURI = serviceURI; | 91 | m_ServerURI = serviceURI; |
92 | |||
93 | StatsManager.RegisterStat( | ||
94 | new Stat( | ||
95 | "RequestsMade", | ||
96 | "Requests made", | ||
97 | "Number of requests made to the remove inventory service", | ||
98 | "requests", | ||
99 | "inventory", | ||
100 | serviceURI, | ||
101 | StatType.Pull, | ||
102 | MeasuresOfInterest.AverageChangeOverTime, | ||
103 | s => s.Value = RequestsMade, | ||
104 | StatVerbosity.Debug)); | ||
86 | } | 105 | } |
87 | 106 | ||
88 | private bool CheckReturn(Dictionary<string, object> ret) | 107 | private bool CheckReturn(Dictionary<string, object> ret) |
@@ -502,6 +521,8 @@ namespace OpenSim.Services.Connectors | |||
502 | foreach (KeyValuePair<string, object> kvp in temp) | 521 | foreach (KeyValuePair<string, object> kvp in temp) |
503 | sendData.Add(kvp.Key, kvp.Value); | 522 | sendData.Add(kvp.Key, kvp.Value); |
504 | 523 | ||
524 | RequestsMade++; | ||
525 | |||
505 | string reply = string.Empty; | 526 | string reply = string.Empty; |
506 | lock (m_Lock) | 527 | lock (m_Lock) |
507 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 528 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |