aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Inventory
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-26 02:17:04 +0100
committerJustin Clark-Casey (justincc)2014-07-26 02:17:04 +0100
commit327632dc66981c4271ca80c7aa62f934e2371162 (patch)
treef58a1187c923ac2a8992ae38edfcf9891dfe2793 /OpenSim/Services/Connectors/Inventory
parentFix issue with TestTextureNotFound in previous commit 1e3027a (diff)
downloadopensim-SC-327632dc66981c4271ca80c7aa62f934e2371162.zip
opensim-SC-327632dc66981c4271ca80c7aa62f934e2371162.tar.gz
opensim-SC-327632dc66981c4271ca80c7aa62f934e2371162.tar.bz2
opensim-SC-327632dc66981c4271ca80c7aa62f934e2371162.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.)
Diffstat (limited to 'OpenSim/Services/Connectors/Inventory')
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index b914737..93f9d48 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
@@ -34,6 +34,7 @@ using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
36using OpenSim.Framework.Communications; 36using OpenSim.Framework.Communications;
37using OpenSim.Framework.Monitoring;
37using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
38using OpenSim.Server.Base; 39using OpenSim.Server.Base;
39using OpenMetaverse; 40using 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 /// <summary> 57 /// <summary>
@@ -93,6 +99,19 @@ namespace OpenSim.Services.Connectors
93 m_ServerURI = serviceURI; 99 m_ServerURI = serviceURI;
94 100
95 m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs); 101 m_requestTimeoutSecs = config.GetInt("RemoteRequestTimeout", m_requestTimeoutSecs);
102
103 StatsManager.RegisterStat(
104 new Stat(
105 "RequestsMade",
106 "Requests made",
107 "Number of requests made to the remove inventory service",
108 "requests",
109 "inventory",
110 serviceURI,
111 StatType.Pull,
112 MeasuresOfInterest.AverageChangeOverTime,
113 s => s.Value = RequestsMade,
114 StatVerbosity.Debug));
96 } 115 }
97 116
98 private bool CheckReturn(Dictionary<string, object> ret) 117 private bool CheckReturn(Dictionary<string, object> ret)
@@ -512,6 +531,8 @@ namespace OpenSim.Services.Connectors
512 foreach (KeyValuePair<string, object> kvp in temp) 531 foreach (KeyValuePair<string, object> kvp in temp)
513 sendData.Add(kvp.Key, kvp.Value); 532 sendData.Add(kvp.Key, kvp.Value);
514 533
534 RequestsMade++;
535
515 string reply = string.Empty; 536 string reply = string.Empty;
516 lock (m_Lock) 537 lock (m_Lock)
517 reply = SynchronousRestFormsRequester.MakeRequest("POST", 538 reply = SynchronousRestFormsRequester.MakeRequest("POST",