aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie Thielker2015-02-18 01:14:08 +0100
committerMelanie Thielker2015-02-18 01:14:08 +0100
commitfed566b8d3bb480ec89615e011934c10023a4dad (patch)
tree13c497f738651fe766ae115c92ee3a06fe5efe24 /OpenSim/Framework
parentfix axis locking Amotor (diff)
downloadopensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.zip
opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.tar.gz
opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.tar.bz2
opensim-SC-fed566b8d3bb480ec89615e011934c10023a4dad.tar.xz
Abbreviate the stats by removing unneeded and redundant elements. Human readability is overrated. Also add a (hardcoded) password.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/ServerStatsCollector.cs43
-rw-r--r--OpenSim/Framework/Monitoring/Stats/Stat.cs13
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs15
3 files changed, 68 insertions, 3 deletions
diff --git a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs
index ac0f0bc..e6c73d3 100644
--- a/OpenSim/Framework/Monitoring/ServerStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/ServerStatsCollector.cs
@@ -246,6 +246,49 @@ namespace OpenSim.Framework.Monitoring
246 (s) => { s.Value = Math.Round(MemoryWatchdog.LastHeapAllocationRate * 1000d / 1024d / 1024d, 3); }); 246 (s) => { s.Value = Math.Round(MemoryWatchdog.LastHeapAllocationRate * 1000d / 1024d / 1024d, 3); });
247 MakeStat("AverageHeapAllocationRate", null, "MB/sec", ContainerMemory, 247 MakeStat("AverageHeapAllocationRate", null, "MB/sec", ContainerMemory,
248 (s) => { s.Value = Math.Round(MemoryWatchdog.AverageHeapAllocationRate * 1000d / 1024d / 1024d, 3); }); 248 (s) => { s.Value = Math.Round(MemoryWatchdog.AverageHeapAllocationRate * 1000d / 1024d / 1024d, 3); });
249
250 MakeStat("ProcessResident", null, "MB", ContainerProcess,
251 (s) =>
252 {
253 Process myprocess = Process.GetCurrentProcess();
254 myprocess.Refresh();
255 s.Value = Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0);
256 });
257 MakeStat("ProcessPaged", null, "MB", ContainerProcess,
258 (s) =>
259 {
260 Process myprocess = Process.GetCurrentProcess();
261 myprocess.Refresh();
262 s.Value = Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0);
263 });
264 MakeStat("ProcessVirtual", null, "MB", ContainerProcess,
265 (s) =>
266 {
267 Process myprocess = Process.GetCurrentProcess();
268 myprocess.Refresh();
269 s.Value = Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0);
270 });
271 MakeStat("PeakProcessResident", null, "MB", ContainerProcess,
272 (s) =>
273 {
274 Process myprocess = Process.GetCurrentProcess();
275 myprocess.Refresh();
276 s.Value = Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0);
277 });
278 MakeStat("PeakProcessPaged", null, "MB", ContainerProcess,
279 (s) =>
280 {
281 Process myprocess = Process.GetCurrentProcess();
282 myprocess.Refresh();
283 s.Value = Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0);
284 });
285 MakeStat("PeakProcessVirtual", null, "MB", ContainerProcess,
286 (s) =>
287 {
288 Process myprocess = Process.GetCurrentProcess();
289 myprocess.Refresh();
290 s.Value = Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0);
291 });
249 } 292 }
250 293
251 // Notes on performance counters: 294 // Notes on performance counters:
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs
index e095801..bd757d0 100644
--- a/OpenSim/Framework/Monitoring/Stats/Stat.cs
+++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs
@@ -238,6 +238,17 @@ namespace OpenSim.Framework.Monitoring
238 return sb.ToString(); 238 return sb.ToString();
239 } 239 }
240 240
241 public virtual OSDMap ToBriefOSDMap()
242 {
243 OSDMap ret = new OSDMap();
244
245 ret.Add("Value", OSD.FromReal(Value));
246
247 double lastChangeOverTime, averageChangeOverTime;
248
249 return ret;
250 }
251
241 public virtual OSDMap ToOSDMap() 252 public virtual OSDMap ToOSDMap()
242 { 253 {
243 OSDMap ret = new OSDMap(); 254 OSDMap ret = new OSDMap();
@@ -322,4 +333,4 @@ namespace OpenSim.Framework.Monitoring
322 } 333 }
323 } 334 }
324 } 335 }
325} \ No newline at end of file 336}
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 05ee4c5..249cef6 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -253,7 +253,7 @@ namespace OpenSim.Framework.Monitoring
253 if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName)) 253 if (!(String.IsNullOrEmpty(pStatName) || pStatName == AllSubCommand || pStatName == statName))
254 continue; 254 continue;
255 255
256 statMap.Add(statName, theStats[statName].ToOSDMap()); 256 statMap.Add(statName, theStats[statName].ToBriefOSDMap());
257 } 257 }
258 258
259 contMap.Add(contName, statMap); 259 contMap.Add(contName, statMap);
@@ -275,6 +275,17 @@ namespace OpenSim.Framework.Monitoring
275 string pContainerName = StatsManager.AllSubCommand; 275 string pContainerName = StatsManager.AllSubCommand;
276 string pStatName = StatsManager.AllSubCommand; 276 string pStatName = StatsManager.AllSubCommand;
277 277
278 if (!request.ContainsKey("pass") || request["pass"].ToString() != "l0st4nge1s")
279 {
280 responsedata["int_response_code"] = response_code;
281 responsedata["content_type"] = "text/plain";
282 responsedata["keepalive"] = false;
283 responsedata["str_response_string"] = "Access denied";
284 responsedata["access_control_allow_origin"] = "*";
285
286 return responsedata;
287 }
288
278 if (request.ContainsKey("cat")) pCategoryName = request["cat"].ToString(); 289 if (request.ContainsKey("cat")) pCategoryName = request["cat"].ToString();
279 if (request.ContainsKey("cont")) pContainerName = request["cat"].ToString(); 290 if (request.ContainsKey("cont")) pContainerName = request["cat"].ToString();
280 if (request.ContainsKey("stat")) pStatName = request["cat"].ToString(); 291 if (request.ContainsKey("stat")) pStatName = request["cat"].ToString();
@@ -524,4 +535,4 @@ namespace OpenSim.Framework.Monitoring
524 Debug, 535 Debug,
525 Info 536 Info
526 } 537 }
527} \ No newline at end of file 538}