aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-02-06 08:03:22 +0000
committerTeravus Ovares2008-02-06 08:03:22 +0000
commit9cd9e90e7f174ab0d84af2df6aff7d23b3493552 (patch)
treeba54a04de7b6f2a64ff0edd6db8d59c4717552c0 /OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
parentRevert color console changes until a cross-platform method is found. (diff)
downloadopensim-SC_OLD-9cd9e90e7f174ab0d84af2df6aff7d23b3493552.zip
opensim-SC_OLD-9cd9e90e7f174ab0d84af2df6aff7d23b3493552.tar.gz
opensim-SC_OLD-9cd9e90e7f174ab0d84af2df6aff7d23b3493552.tar.bz2
opensim-SC_OLD-9cd9e90e7f174ab0d84af2df6aff7d23b3493552.tar.xz
* Added Active Scripts to report the number of scripts running to Sim Stats
* Added Script Performance to report the number of functions run per second to Sim Stats. * Removed a few warnings (@.@ up to 50 now)
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SimStatsReporter.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs31
1 files changed, 29 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index 3bd7e4a..f2cefb5 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -51,10 +51,13 @@ namespace OpenSim.Region.Environment.Scenes
51 PhysicsMS = 7, 51 PhysicsMS = 7,
52 AgentMS = 8, 52 AgentMS = 8,
53 ImageMS = 9, 53 ImageMS = 9,
54 ScriptMS = 10,
54 TotalPrim = 11, 55 TotalPrim = 11,
55 ActivePrim = 12, 56 ActivePrim = 12,
56 Agents = 13, 57 Agents = 13,
57 ChildAgents = 14, 58 ChildAgents = 14,
59 ActiveScripts = 15,
60 ScriptLinesPerSecond = 16,
58 InPacketsPerSecond = 17, 61 InPacketsPerSecond = 17,
59 OutPacketsPerSecond = 18, 62 OutPacketsPerSecond = 18,
60 PendingDownloads = 19, 63 PendingDownloads = 19,
@@ -74,12 +77,15 @@ namespace OpenSim.Region.Environment.Scenes
74 private int m_fps = 0; 77 private int m_fps = 0;
75 private float m_pfps = 0; 78 private float m_pfps = 0;
76 private int m_agentUpdates = 0; 79 private int m_agentUpdates = 0;
80
77 private int m_frameMS = 0; 81 private int m_frameMS = 0;
78 private int m_netMS = 0; 82 private int m_netMS = 0;
79 private int m_agentMS = 0; 83 private int m_agentMS = 0;
80 private int m_physicsMS = 0; 84 private int m_physicsMS = 0;
81 private int m_imageMS = 0; 85 private int m_imageMS = 0;
82 private int m_otherMS = 0; 86 private int m_otherMS = 0;
87 private int m_scriptMS = 0;
88
83 private int m_rootAgents = 0; 89 private int m_rootAgents = 0;
84 private int m_childAgents = 0; 90 private int m_childAgents = 0;
85 private int m_numPrim = 0; 91 private int m_numPrim = 0;
@@ -89,9 +95,11 @@ namespace OpenSim.Region.Environment.Scenes
89 private int m_unAckedBytes = 0; 95 private int m_unAckedBytes = 0;
90 private int m_pendingDownloads = 0; 96 private int m_pendingDownloads = 0;
91 private int m_pendingUploads = 0; 97 private int m_pendingUploads = 0;
98 private int m_activeScripts = 0;
99 private int m_scriptLinesPerSecond = 0;
92 100
93 101
94 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[19]; 102 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21];
95 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 103 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
96 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); 104 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats);
97 105
@@ -106,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
106 114
107 statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000); 115 statsUpdateFactor = (float)(statsUpdatesEveryMS / 1000);
108 ReportingRegion = regionData; 116 ReportingRegion = regionData;
109 for (int i = 0; i<19;i++) 117 for (int i = 0; i<21;i++)
110 { 118 {
111 sb[i] = new SimStatsPacket.StatBlock(); 119 sb[i] = new SimStatsPacket.StatBlock();
112 } 120 }
@@ -222,6 +230,12 @@ namespace OpenSim.Region.Environment.Scenes
222 sb[18].StatID = (uint)Stats.PendingUploads; 230 sb[18].StatID = (uint)Stats.PendingUploads;
223 sb[18].StatValue = m_pendingUploads; 231 sb[18].StatValue = m_pendingUploads;
224 232
233 sb[19].StatID = (uint)Stats.ActiveScripts;
234 sb[19].StatValue = m_activeScripts;
235
236 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
237 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
238
225 statpack.Stat = sb; 239 statpack.Stat = sb;
226 240
227 if (OnSendStatsResult != null) 241 if (OnSendStatsResult != null)
@@ -241,12 +255,15 @@ namespace OpenSim.Region.Environment.Scenes
241 m_inPacketsPerSecond = 0; 255 m_inPacketsPerSecond = 0;
242 m_outPacketsPerSecond = 0; 256 m_outPacketsPerSecond = 0;
243 m_unAckedBytes = 0; 257 m_unAckedBytes = 0;
258 m_scriptLinesPerSecond = 0;
259
244 m_frameMS = 0; 260 m_frameMS = 0;
245 m_agentMS = 0; 261 m_agentMS = 0;
246 m_netMS = 0; 262 m_netMS = 0;
247 m_physicsMS = 0; 263 m_physicsMS = 0;
248 m_imageMS = 0; 264 m_imageMS = 0;
249 m_otherMS = 0; 265 m_otherMS = 0;
266 m_scriptMS = 0;
250 } 267 }
251 268
252 # region methods called from Scene 269 # region methods called from Scene
@@ -344,6 +361,16 @@ namespace OpenSim.Region.Environment.Scenes
344 m_pendingDownloads += count; 361 m_pendingDownloads += count;
345 } 362 }
346 363
364 public void addScriptLines(int count)
365 {
366 m_scriptLinesPerSecond += count;
367 }
368
369 public void SetActiveScripts(int count)
370 {
371 m_activeScripts = count;
372 }
373
347 #endregion 374 #endregion
348 375
349 } 376 }