aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2012-04-24 03:05:29 +0100
committerUbitUmarov2012-04-24 03:05:29 +0100
commitb019b20eb89aab60df1a1a5c47b5b5cc4aebc4d9 (patch)
tree3185bb851cd6ba07dbd815251124a35b46f12bde /OpenSim/Region
parentubitODE - do own timing control (as chODE does) until heartbeat does it right (diff)
downloadopensim-SC_OLD-b019b20eb89aab60df1a1a5c47b5b5cc4aebc4d9.zip
opensim-SC_OLD-b019b20eb89aab60df1a1a5c47b5b5cc4aebc4d9.tar.gz
opensim-SC_OLD-b019b20eb89aab60df1a1a5c47b5b5cc4aebc4d9.tar.bz2
opensim-SC_OLD-b019b20eb89aab60df1a1a5c47b5b5cc4aebc4d9.tar.xz
*testing* changed stats time reports to be per reported frame and not acumulated in about 1second. Total Frame Time is not just 1/reported sim fps
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs75
1 files changed, 64 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 5c56264..31f5b88 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -75,7 +75,20 @@ namespace OpenSim.Region.Framework.Scenes
75 OutPacketsPerSecond = 18, 75 OutPacketsPerSecond = 18,
76 PendingDownloads = 19, 76 PendingDownloads = 19,
77 PendingUploads = 20, 77 PendingUploads = 20,
78 VirtualSizeKB = 21,
79 ResidentSizeKB = 22,
80 PendingLocalUploads = 23,
78 UnAckedBytes = 24, 81 UnAckedBytes = 24,
82 PhysicsPinnedTasks = 25,
83 PhysicsLODTasks = 26,
84 PhysicsStepMS = 27,
85 PhysicsShapeMS = 28,
86 PhysicsOtherMS = 29,
87 PhysicsMemory = 30,
88 ScriptEPS = 31,
89 SimSpareTime = 32,
90 SimSleepTime = 33,
91 IOPumpTime = 34
79 } 92 }
80 93
81 /// <summary> 94 /// <summary>
@@ -123,7 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
123 136
124 // saved last reported value so there is something available for llGetRegionFPS 137 // saved last reported value so there is something available for llGetRegionFPS
125 private float lastReportedSimFPS = 0; 138 private float lastReportedSimFPS = 0;
126 private float[] lastReportedSimStats = new float[21]; 139 private float[] lastReportedSimStats = new float[23];
127 private float m_pfps = 0; 140 private float m_pfps = 0;
128 141
129 /// <summary> 142 /// <summary>
@@ -142,6 +155,8 @@ namespace OpenSim.Region.Framework.Scenes
142 private int m_physicsMS = 0; 155 private int m_physicsMS = 0;
143 private int m_imageMS = 0; 156 private int m_imageMS = 0;
144 private int m_otherMS = 0; 157 private int m_otherMS = 0;
158 private int m_sleeptimeMS = 0;
159
145 160
146//Ckrinke: (3-21-08) Comment out to remove a compiler warning. Bring back into play when needed. 161//Ckrinke: (3-21-08) Comment out to remove a compiler warning. Bring back into play when needed.
147//Ckrinke private int m_scriptMS = 0; 162//Ckrinke private int m_scriptMS = 0;
@@ -200,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
200 215
201 private void statsHeartBeat(object sender, EventArgs e) 216 private void statsHeartBeat(object sender, EventArgs e)
202 { 217 {
203 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[21]; 218 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[23];
204 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 219 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
205 220
206 // Know what's not thread safe in Mono... modifying timers. 221 // Know what's not thread safe in Mono... modifying timers.
@@ -249,7 +264,26 @@ namespace OpenSim.Region.Framework.Scenes
249 // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change 264 // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change
250 // values to X-per-second values. 265 // values to X-per-second values.
251 266
252 for (int i = 0; i < 21; i++) 267 float factor = 1 / statsUpdateFactor;
268 if (reportedFPS <= 0)
269 reportedFPS = 1;
270 float TotalFrameTime = 1000.0f * statsUpdateFactor / (float)reportedFPS;
271 float perframe = 1.0f / (float)reportedFPS;
272
273 float sparetime;
274 if (m_nominalReportedFps <= 0)
275 sparetime = 0;
276 else
277 {
278 sparetime = 1000.0f / (float)m_nominalReportedFps;
279 sparetime -= m_frameMS * perframe;
280 if (sparetime < 0)
281 sparetime = 0;
282 else if (sparetime > TotalFrameTime)
283 sparetime = TotalFrameTime;
284 }
285
286 for (int i = 0; i < 23; i++)
253 { 287 {
254 sb[i] = new SimStatsPacket.StatBlock(); 288 sb[i] = new SimStatsPacket.StatBlock();
255 } 289 }
@@ -279,19 +313,25 @@ namespace OpenSim.Region.Framework.Scenes
279 sb[7].StatValue = m_activePrim; 313 sb[7].StatValue = m_activePrim;
280 314
281 sb[8].StatID = (uint)Stats.FrameMS; 315 sb[8].StatID = (uint)Stats.FrameMS;
282 sb[8].StatValue = m_frameMS / statsUpdateFactor; 316 // sb[8].StatValue = m_frameMS / statsUpdateFactor;
317 sb[8].StatValue = TotalFrameTime;
283 318
284 sb[9].StatID = (uint)Stats.NetMS; 319 sb[9].StatID = (uint)Stats.NetMS;
285 sb[9].StatValue = m_netMS / statsUpdateFactor; 320 // sb[9].StatValue = m_netMS / statsUpdateFactor;
321 sb[9].StatValue = m_netMS * perframe;
286 322
287 sb[10].StatID = (uint)Stats.PhysicsMS; 323 sb[10].StatID = (uint)Stats.PhysicsMS;
288 sb[10].StatValue = m_physicsMS / statsUpdateFactor; 324 // sb[10].StatValue = m_physicsMS / statsUpdateFactor;
325 sb[10].StatValue = m_physicsMS * perframe;
289 326
290 sb[11].StatID = (uint)Stats.ImageMS ; 327 sb[11].StatID = (uint)Stats.ImageMS ;
291 sb[11].StatValue = m_imageMS / statsUpdateFactor; 328 // sb[11].StatValue = m_imageMS / statsUpdateFactor;
329 sb[11].StatValue = m_imageMS * perframe;
292 330
293 sb[12].StatID = (uint)Stats.OtherMS; 331 sb[12].StatID = (uint)Stats.OtherMS;
294 sb[12].StatValue = m_otherMS / statsUpdateFactor; 332 // sb[12].StatValue = m_otherMS / statsUpdateFactor;
333 sb[12].StatValue = m_otherMS * perframe;
334
295 335
296 sb[13].StatID = (uint)Stats.InPacketsPerSecond; 336 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
297 sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor); 337 sb[13].StatValue = (m_inPacketsPerSecond / statsUpdateFactor);
@@ -303,7 +343,8 @@ namespace OpenSim.Region.Framework.Scenes
303 sb[15].StatValue = m_unAckedBytes; 343 sb[15].StatValue = m_unAckedBytes;
304 344
305 sb[16].StatID = (uint)Stats.AgentMS; 345 sb[16].StatID = (uint)Stats.AgentMS;
306 sb[16].StatValue = m_agentMS / statsUpdateFactor; 346// sb[16].StatValue = m_agentMS / statsUpdateFactor;
347 sb[16].StatValue = m_agentMS * perframe;
307 348
308 sb[17].StatID = (uint)Stats.PendingDownloads; 349 sb[17].StatID = (uint)Stats.PendingDownloads;
309 sb[17].StatValue = m_pendingDownloads; 350 sb[17].StatValue = m_pendingDownloads;
@@ -316,8 +357,14 @@ namespace OpenSim.Region.Framework.Scenes
316 357
317 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; 358 sb[20].StatID = (uint)Stats.ScriptLinesPerSecond;
318 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; 359 sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor;
319 360
320 for (int i = 0; i < 21; i++) 361 sb[21].StatID = (uint)Stats.SimSpareTime;
362 sb[21].StatValue = sparetime;
363
364 sb[22].StatID = (uint)Stats.SimSleepTime;
365 sb[22].StatValue = m_sleeptimeMS * perframe;
366
367 for (int i = 0; i < 23; i++)
321 { 368 {
322 lastReportedSimStats[i] = sb[i].StatValue; 369 lastReportedSimStats[i] = sb[i].StatValue;
323 } 370 }
@@ -358,6 +405,7 @@ namespace OpenSim.Region.Framework.Scenes
358 m_physicsMS = 0; 405 m_physicsMS = 0;
359 m_imageMS = 0; 406 m_imageMS = 0;
360 m_otherMS = 0; 407 m_otherMS = 0;
408 m_sleeptimeMS = 0;
361 409
362//Ckrinke This variable is not used, so comment to remove compiler warning until it is used. 410//Ckrinke This variable is not used, so comment to remove compiler warning until it is used.
363//Ckrinke m_scriptMS = 0; 411//Ckrinke m_scriptMS = 0;
@@ -484,6 +532,11 @@ namespace OpenSim.Region.Framework.Scenes
484 m_otherMS += ms; 532 m_otherMS += ms;
485 } 533 }
486 534
535 public void addSleepMS(int ms)
536 {
537 m_sleeptimeMS += ms;
538 }
539
487 public void AddPendingDownloads(int count) 540 public void AddPendingDownloads(int count)
488 { 541 {
489 m_pendingDownloads += count; 542 m_pendingDownloads += count;