aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-06-19 20:48:12 +0100
committerJustin Clark-Casey (justincc)2013-06-19 20:48:12 +0100
commit84af1cab9ba991b2356f1025cab7f58433e2ec19 (patch)
treea8e0b752502e0486d1927a29448d37ab4300877a /OpenSim
parentMantis 6608: Math error in parcel dimensions/borders seen with land show command (diff)
downloadopensim-SC_OLD-84af1cab9ba991b2356f1025cab7f58433e2ec19.zip
opensim-SC_OLD-84af1cab9ba991b2356f1025cab7f58433e2ec19.tar.gz
opensim-SC_OLD-84af1cab9ba991b2356f1025cab7f58433e2ec19.tar.bz2
opensim-SC_OLD-84af1cab9ba991b2356f1025cab7f58433e2ec19.tar.xz
Display existing statistic of how many http requests a server is making as server.network.HTTPRequestsMade in "show stats all"
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Monitoring/ServerStatsCollector.cs21
-rw-r--r--OpenSim/Framework/Monitoring/Stats/Stat.cs5
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
3 files changed, 23 insertions, 5 deletions
diff --git a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs
index 0ab4b93..07ca14b 100644
--- a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs
@@ -114,10 +114,15 @@ namespace OpenSim.Framework.Monitoring
114 114
115 private void MakeStat(string pName, string pDesc, string pUnit, string pContainer, Action<Stat> act) 115 private void MakeStat(string pName, string pDesc, string pUnit, string pContainer, Action<Stat> act)
116 { 116 {
117 MakeStat(pName, pDesc, pUnit, pContainer, act, MeasuresOfInterest.None);
118 }
119
120 private void MakeStat(string pName, string pDesc, string pUnit, string pContainer, Action<Stat> act, MeasuresOfInterest moi)
121 {
117 string desc = pDesc; 122 string desc = pDesc;
118 if (desc == null) 123 if (desc == null)
119 desc = pName; 124 desc = pName;
120 Stat stat = new Stat(pName, pName, desc, pUnit, CategoryServer, pContainer, StatType.Pull, act, StatVerbosity.Debug); 125 Stat stat = new Stat(pName, pName, desc, pUnit, CategoryServer, pContainer, StatType.Pull, moi, act, StatVerbosity.Debug);
121 StatsManager.RegisterStat(stat); 126 StatsManager.RegisterStat(stat);
122 RegisteredStats.Add(pName, stat); 127 RegisteredStats.Add(pName, stat);
123 } 128 }
@@ -141,7 +146,7 @@ namespace OpenSim.Framework.Monitoring
141 StatsManager.RegisterStat(tempStat); 146 StatsManager.RegisterStat(tempStat);
142 RegisteredStats.Add(tempName, tempStat); 147 RegisteredStats.Add(tempName, tempStat);
143 148
144 MakeStat("TotalProcessorTime", null, "sec", ContainerProcessor, 149 MakeStat("TotalProcessorTime", null, "sec", ContainerProcessor,
145 (s) => { s.Value = Process.GetCurrentProcess().TotalProcessorTime.TotalSeconds; }); 150 (s) => { s.Value = Process.GetCurrentProcess().TotalProcessorTime.TotalSeconds; });
146 151
147 MakeStat("UserProcessorTime", null, "sec", ContainerProcessor, 152 MakeStat("UserProcessorTime", null, "sec", ContainerProcessor,
@@ -158,7 +163,7 @@ namespace OpenSim.Framework.Monitoring
158 m_log.ErrorFormat("{0} Exception creating 'Process': {1}", LogHeader, e); 163 m_log.ErrorFormat("{0} Exception creating 'Process': {1}", LogHeader, e);
159 } 164 }
160 165
161 MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool, 166 MakeStat("BuiltinThreadpoolWorkerThreadsAvailable", null, "threads", ContainerThreadpool,
162 s => 167 s =>
163 { 168 {
164 int workerThreads, iocpThreads; 169 int workerThreads, iocpThreads;
@@ -166,7 +171,7 @@ namespace OpenSim.Framework.Monitoring
166 s.Value = workerThreads; 171 s.Value = workerThreads;
167 }); 172 });
168 173
169 MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool, 174 MakeStat("BuiltinThreadpoolIOCPThreadsAvailable", null, "threads", ContainerThreadpool,
170 s => 175 s =>
171 { 176 {
172 int workerThreads, iocpThreads; 177 int workerThreads, iocpThreads;
@@ -184,6 +189,14 @@ namespace OpenSim.Framework.Monitoring
184 MakeStat("STPWorkItemsWaiting", null, "threads", ContainerThreadpool, s => s.Value = Util.GetSmartThreadPoolInfo().WaitingCallbacks); 189 MakeStat("STPWorkItemsWaiting", null, "threads", ContainerThreadpool, s => s.Value = Util.GetSmartThreadPoolInfo().WaitingCallbacks);
185 } 190 }
186 191
192 MakeStat(
193 "HTTPRequestsMade",
194 "Number of outbound HTTP requests made",
195 "requests",
196 ContainerNetwork,
197 s => s.Value = WebUtil.RequestNumber,
198 MeasuresOfInterest.AverageChangeOverTime);
199
187 try 200 try
188 { 201 {
189 List<string> okInterfaceTypes = new List<string>(NetworkInterfaceTypes.Split(',')); 202 List<string> okInterfaceTypes = new List<string>(NetworkInterfaceTypes.Split(','));
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs
index eb5599f..85d1a78 100644
--- a/OpenSim/Framework/Monitoring/Stats/Stat.cs
+++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Linq;
30using System.Reflection; 31using System.Reflection;
31using System.Text; 32using System.Text;
32using log4net; 33using log4net;
@@ -247,6 +248,10 @@ namespace OpenSim.Framework.Monitoring
247 248
248 lock (m_samples) 249 lock (m_samples)
249 { 250 {
251// m_log.DebugFormat(
252// "[STAT]: Samples for {0} are {1}",
253// Name, string.Join(",", m_samples.Select(s => s.ToString()).ToArray()));
254
250 foreach (double s in m_samples) 255 foreach (double s in m_samples)
251 { 256 {
252 if (lastSample != null) 257 if (lastSample != null)
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 6687441..40b8c5c 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -1829,7 +1829,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1829 1829
1830 m_requestsProcessedStat 1830 m_requestsProcessedStat
1831 = new Stat( 1831 = new Stat(
1832 "IncomingHTTPRequestsProcessed", 1832 "HTTPRequestsServed",
1833 "Number of inbound HTTP requests processed", 1833 "Number of inbound HTTP requests processed",
1834 "", 1834 "",
1835 "requests", 1835 "requests",