aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rwxr-xr-x[-rw-r--r--]OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
index f6f458d..432efdb 100644..100755
--- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Diagnostics;
30using System.Linq; 31using System.Linq;
31using System.Text; 32using System.Text;
32using OpenMetaverse; 33using OpenMetaverse;
@@ -71,6 +72,11 @@ namespace OpenSim.Framework.Monitoring
71 private volatile float pendingUploads; 72 private volatile float pendingUploads;
72 private volatile float activeScripts; 73 private volatile float activeScripts;
73 private volatile float scriptLinesPerSecond; 74 private volatile float scriptLinesPerSecond;
75 private volatile float m_frameDilation;
76 private volatile float m_usersLoggingIn;
77 private volatile float m_totalGeoPrims;
78 private volatile float m_totalMeshes;
79 private volatile float m_inUseThreads;
74 80
75// /// <summary> 81// /// <summary>
76// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the 82// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
@@ -249,6 +255,10 @@ namespace OpenSim.Framework.Monitoring
249 { 255 {
250 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original 256 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original
251 // SimStatsPacket that was being used). 257 // SimStatsPacket that was being used).
258
259 // For an unknown reason the original designers decided not to
260 // include the spare MS statistic inside of this class, this is
261 // located inside the StatsBlock at location 21, thus it is skipped
252 timeDilation = stats.StatsBlock[0].StatValue; 262 timeDilation = stats.StatsBlock[0].StatValue;
253 simFps = stats.StatsBlock[1].StatValue; 263 simFps = stats.StatsBlock[1].StatValue;
254 physicsFps = stats.StatsBlock[2].StatValue; 264 physicsFps = stats.StatsBlock[2].StatValue;
@@ -270,6 +280,11 @@ namespace OpenSim.Framework.Monitoring
270 pendingUploads = stats.StatsBlock[18].StatValue; 280 pendingUploads = stats.StatsBlock[18].StatValue;
271 activeScripts = stats.StatsBlock[19].StatValue; 281 activeScripts = stats.StatsBlock[19].StatValue;
272 scriptLinesPerSecond = stats.StatsBlock[20].StatValue; 282 scriptLinesPerSecond = stats.StatsBlock[20].StatValue;
283 m_frameDilation = stats.StatsBlock[22].StatValue;
284 m_usersLoggingIn = stats.StatsBlock[23].StatValue;
285 m_totalGeoPrims = stats.StatsBlock[24].StatValue;
286 m_totalMeshes = stats.StatsBlock[25].StatValue;
287 m_inUseThreads = stats.StatsBlock[26].StatValue;
273 } 288 }
274 289
275 /// <summary> 290 /// <summary>
@@ -407,6 +422,23 @@ Asset service request failures: {3}" + Environment.NewLine,
407 /// <returns></returns> 422 /// <returns></returns>
408 public override OSDMap OReport(string uptime, string version) 423 public override OSDMap OReport(string uptime, string version)
409 { 424 {
425 // Get the amount of physical memory, allocated with the instance of this program, in kilobytes;
426 // the working set is the set of memory pages currently visible to this program in physical RAM
427 // memory and includes both shared (e.g. system libraries) and private data
428 double memUsage = Process.GetCurrentProcess().WorkingSet64 / 1024.0;
429
430 // Get the number of threads from the system that are currently
431 // running
432 int numberThreadsRunning = 0;
433 foreach (ProcessThread currentThread in
434 Process.GetCurrentProcess().Threads)
435 {
436 if (currentThread.ThreadState == ThreadState.Running)
437 {
438 numberThreadsRunning++;
439 }
440 }
441
410 OSDMap args = new OSDMap(30); 442 OSDMap args = new OSDMap(30);
411// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache)); 443// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
412// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}", 444// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
@@ -443,6 +475,22 @@ Asset service request failures: {3}" + Environment.NewLine,
443 args["Memory"] = OSD.FromString (base.XReport (uptime, version)); 475 args["Memory"] = OSD.FromString (base.XReport (uptime, version));
444 args["Uptime"] = OSD.FromString (uptime); 476 args["Uptime"] = OSD.FromString (uptime);
445 args["Version"] = OSD.FromString (version); 477 args["Version"] = OSD.FromString (version);
478
479 args["FrameDilatn"] = OSD.FromString(String.Format("{0:0.##}", m_frameDilation));
480 args["Logging in Users"] = OSD.FromString(String.Format("{0:0.##}",
481 m_usersLoggingIn));
482 args["GeoPrims"] = OSD.FromString(String.Format("{0:0.##}",
483 m_totalGeoPrims));
484 args["Mesh Objects"] = OSD.FromString(String.Format("{0:0.##}",
485 m_totalMeshes));
486 args["XEngine Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
487 m_inUseThreads));
488 args["Util Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
489 Util.GetSmartThreadPoolInfo().InUseThreads));
490 args["System Thread Count"] = OSD.FromString(String.Format(
491 "{0:0.##}", numberThreadsRunning));
492 args["ProcMem"] = OSD.FromString(String.Format("{0:#,###,###.##}",
493 memUsage));
446 494
447 return args; 495 return args;
448 } 496 }