aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
diff options
context:
space:
mode:
authorGlenn Martin2015-04-20 14:55:00 -0400
committerGlenn Martin2015-04-21 14:29:17 -0400
commit1959eb8372b6c8e35e1afa435504e9ef41dec958 (patch)
treed9cb670464215a7baeaee11638544635237f5eb7 /OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
parentRevert "Enable grab feature (Ctrl+Drag) for non-physical link-sets and add co... (diff)
downloadopensim-SC-1959eb8372b6c8e35e1afa435504e9ef41dec958.zip
opensim-SC-1959eb8372b6c8e35e1afa435504e9ef41dec958.tar.gz
opensim-SC-1959eb8372b6c8e35e1afa435504e9ef41dec958.tar.bz2
opensim-SC-1959eb8372b6c8e35e1afa435504e9ef41dec958.tar.xz
Moved over metrics from previous OpenSim 0.8.0.3 repository (this new repository is now the master branch from OpenSim).
Diffstat (limited to 'OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs')
-rwxr-xr-x[-rw-r--r--]OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
index f6f458d..98fa65a 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,10 @@ 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_usersLoggingIn;
76 private volatile float m_totalGeoPrims;
77 private volatile float m_totalMeshes;
78 private volatile float m_inUseThreads;
74 79
75// /// <summary> 80// /// <summary>
76// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the 81// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
@@ -249,6 +254,10 @@ namespace OpenSim.Framework.Monitoring
249 { 254 {
250 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original 255 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original
251 // SimStatsPacket that was being used). 256 // SimStatsPacket that was being used).
257
258 // For an unknown reason the original designers decided not to
259 // include the spare MS statistic inside of this class, this is
260 // located inside the StatsBlock at location 21 thus it is skipped
252 timeDilation = stats.StatsBlock[0].StatValue; 261 timeDilation = stats.StatsBlock[0].StatValue;
253 simFps = stats.StatsBlock[1].StatValue; 262 simFps = stats.StatsBlock[1].StatValue;
254 physicsFps = stats.StatsBlock[2].StatValue; 263 physicsFps = stats.StatsBlock[2].StatValue;
@@ -270,6 +279,10 @@ namespace OpenSim.Framework.Monitoring
270 pendingUploads = stats.StatsBlock[18].StatValue; 279 pendingUploads = stats.StatsBlock[18].StatValue;
271 activeScripts = stats.StatsBlock[19].StatValue; 280 activeScripts = stats.StatsBlock[19].StatValue;
272 scriptLinesPerSecond = stats.StatsBlock[20].StatValue; 281 scriptLinesPerSecond = stats.StatsBlock[20].StatValue;
282 m_usersLoggingIn = stats.StatsBlock[22].StatValue;
283 m_totalGeoPrims = stats.StatsBlock[23].StatValue;
284 m_totalMeshes = stats.StatsBlock[24].StatValue;
285 m_inUseThreads = stats.StatsBlock[25].StatValue;
273 } 286 }
274 287
275 /// <summary> 288 /// <summary>
@@ -407,6 +420,23 @@ Asset service request failures: {3}" + Environment.NewLine,
407 /// <returns></returns> 420 /// <returns></returns>
408 public override OSDMap OReport(string uptime, string version) 421 public override OSDMap OReport(string uptime, string version)
409 { 422 {
423 // Get the amount of physical memory, allocated with the instance of this program, in kilobytes;
424 // the working set is the set of memory pages currently visible to this program in physical RAM
425 // memory and includes both shared (e.g. system libraries) and private data
426 double memUsage = Process.GetCurrentProcess().WorkingSet64 / 1024.0;
427
428 // Get the number of threads from the system that are currently
429 // running
430 int numberThreadsRunning = 0;
431 foreach (ProcessThread currentThread in
432 Process.GetCurrentProcess().Threads)
433 {
434 if (currentThread.ThreadState == ThreadState.Running)
435 {
436 numberThreadsRunning++;
437 }
438 }
439
410 OSDMap args = new OSDMap(30); 440 OSDMap args = new OSDMap(30);
411// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache)); 441// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
412// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}", 442// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
@@ -443,6 +473,23 @@ Asset service request failures: {3}" + Environment.NewLine,
443 args["Memory"] = OSD.FromString (base.XReport (uptime, version)); 473 args["Memory"] = OSD.FromString (base.XReport (uptime, version));
444 args["Uptime"] = OSD.FromString (uptime); 474 args["Uptime"] = OSD.FromString (uptime);
445 args["Version"] = OSD.FromString (version); 475 args["Version"] = OSD.FromString (version);
476
477 args["Logging in Users"] = OSD.FromString(String.Format("{0:0.##}",
478 m_usersLoggingIn));
479 args["GeoPrims"] = OSD.FromString(String.Format("{0:0.##}",
480 m_totalGeoPrims));
481 args["Mesh Objects"] = OSD.FromString(String.Format("{0:0.##}",
482 m_totalMeshes));
483 args["Polygon Count"] = OSD.FromString(String.Format("{0:0.##}", 0));
484 args["Texture Count"] = OSD.FromString(String.Format("{0:0.##}", 0));
485 args["XEngine Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
486 m_inUseThreads));
487 args["Util Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
488 Util.GetSmartThreadPoolInfo().InUseThreads));
489 args["System Thread Count"] = OSD.FromString(String.Format(
490 "{0:0.##}", numberThreadsRunning));
491 args["ProcMem"] = OSD.FromString(String.Format("{0:#,###,###.##}",
492 memUsage));
446 493
447 return args; 494 return args;
448 } 495 }