aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SimStatsReporter.cs')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SimStatsReporter.cs40
1 files changed, 22 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 2174e51..3effee7 100755
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -176,11 +176,16 @@ namespace OpenSim.Region.Framework.Scenes
176 /// Parameter to adjust reported scene fps 176 /// Parameter to adjust reported scene fps
177 /// </summary> 177 /// </summary>
178 /// <remarks> 178 /// <remarks>
179 /// Our scene loop runs slower than other server implementations, apparantly because we work somewhat differently. 179 /// The close we have to a frame rate as expected by viewers, users and scripts
180 /// However, we will still report an FPS that's closer to what people are used to seeing. A lower FPS might 180 /// is heartbeat rate.
181 /// affect clients and monitoring scripts/software. 181 /// heartbeat rate default value is very diferent from the expected one
182 /// and can be changed from region to region acording to its specific simulation needs
183 /// since this creates incompatibility with expected values,
184 /// this scale factor can be used to normalize values to a Virtual FPS.
185 /// original decision was to use a value of 55fps for all opensim
186 /// corresponding, with default heartbeat rate, to a value of 5.
182 /// </remarks> 187 /// </remarks>
183 private float m_reportedFpsCorrectionFactor = 5; 188 private float m_statisticsFPSfactor = 5.0f;
184 189
185 // saved last reported value so there is something available for llGetRegionFPS 190 // saved last reported value so there is something available for llGetRegionFPS
186 private float lastReportedSimFPS; 191 private float lastReportedSimFPS;
@@ -278,10 +283,15 @@ namespace OpenSim.Region.Framework.Scenes
278 m_usersLoggingIn = 0; 283 m_usersLoggingIn = 0;
279 284
280 m_scene = scene; 285 m_scene = scene;
281 m_reportedFpsCorrectionFactor = scene.MinFrameSeconds * m_nominalReportedFps; 286
282 m_statsUpdateFactor = (float)(m_statsUpdatesEveryMS / 1000); 287 m_statsUpdateFactor = (float)(m_statsUpdatesEveryMS / 1000);
283 ReportingRegion = scene.RegionInfo; 288 ReportingRegion = scene.RegionInfo;
284 289
290 if(scene.Normalized55FPS)
291 m_statisticsFPSfactor = 55.0f * m_scene.MinFrameTicks / 1000.0f;
292 else
293 m_statisticsFPSfactor = 1.0f;
294
285 m_objectCapacity = scene.RegionInfo.ObjectCapacity; 295 m_objectCapacity = scene.RegionInfo.ObjectCapacity;
286 m_report.AutoReset = true; 296 m_report.AutoReset = true;
287 m_report.Interval = m_statsUpdatesEveryMS; 297 m_report.Interval = m_statsUpdatesEveryMS;
@@ -381,13 +391,7 @@ namespace OpenSim.Region.Framework.Scenes
381 391
382#region various statistic googly moogly 392#region various statistic googly moogly
383 393
384 // ORIGINAL code commented out until we have time to add our own 394 int reportedFPS = (int)(m_fps * m_statisticsFPSfactor);
385 // statistics to the statistics window, this will be done as a
386 // new section given the title of our current project
387 // We're going to lie about the FPS because we've been lying since 2008. The actual FPS is currently
388 // locked at a maximum of 11. Maybe at some point this can change so that we're not lying.
389 //int reportedFPS = (int)(m_fps * m_reportedFpsCorrectionFactor);
390 int reportedFPS = m_fps;
391 395
392 // save the reported value so there is something available for llGetRegionFPS 396 // save the reported value so there is something available for llGetRegionFPS
393 lastReportedSimFPS = reportedFPS / m_statsUpdateFactor; 397 lastReportedSimFPS = reportedFPS / m_statsUpdateFactor;
@@ -395,7 +399,7 @@ namespace OpenSim.Region.Framework.Scenes
395 // ORIGINAL code commented out until we have time to add our own 399 // ORIGINAL code commented out until we have time to add our own
396 // statistics to the statistics window 400 // statistics to the statistics window
397 //float physfps = ((m_pfps / 1000)); 401 //float physfps = ((m_pfps / 1000));
398 float physfps = m_numberPhysicsFrames; 402 float physfps = m_numberPhysicsFrames * m_statisticsFPSfactor;
399 403
400 //if (physfps > 600) 404 //if (physfps > 600)
401 //physfps = physfps - (physfps - 600); 405 //physfps = physfps - (physfps - 600);
@@ -429,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes
429 433
430 uint thisFrame = m_scene.Frame; 434 uint thisFrame = m_scene.Frame;
431 uint numFrames = thisFrame - m_lastUpdateFrame; 435 uint numFrames = thisFrame - m_lastUpdateFrame;
432 float framesUpdated = (float)numFrames * m_reportedFpsCorrectionFactor; 436 float framesUpdated = (float)numFrames * m_statisticsFPSfactor;
433 m_lastUpdateFrame = thisFrame; 437 m_lastUpdateFrame = thisFrame;
434 438
435 // Avoid div-by-zero if somehow we've not updated any frames. 439 // Avoid div-by-zero if somehow we've not updated any frames.
@@ -502,22 +506,22 @@ namespace OpenSim.Region.Framework.Scenes
502 // statistics to the statistics window 506 // statistics to the statistics window
503 sb[8].StatID = (uint)Stats.FrameMS; 507 sb[8].StatID = (uint)Stats.FrameMS;
504 //sb[8].StatValue = m_frameMS / framesUpdated; 508 //sb[8].StatValue = m_frameMS / framesUpdated;
505 sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored; 509 sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
506 510
507 sb[9].StatID = (uint)Stats.NetMS; 511 sb[9].StatID = (uint)Stats.NetMS;
508 //sb[9].StatValue = m_netMS / framesUpdated; 512 //sb[9].StatValue = m_netMS / framesUpdated;
509 sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored; 513 sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
510 514
511 sb[10].StatID = (uint)Stats.PhysicsMS; 515 sb[10].StatID = (uint)Stats.PhysicsMS;
512 //sb[10].StatValue = m_physicsMS / framesUpdated; 516 //sb[10].StatValue = m_physicsMS / framesUpdated;
513 sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored; 517 sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
514 518
515 sb[11].StatID = (uint)Stats.ImageMS ; 519 sb[11].StatID = (uint)Stats.ImageMS ;
516 sb[11].StatValue = m_imageMS / framesUpdated; 520 sb[11].StatValue = m_imageMS / framesUpdated;
517 521
518 sb[12].StatID = (uint)Stats.OtherMS; 522 sb[12].StatID = (uint)Stats.OtherMS;
519 //sb[12].StatValue = m_otherMS / framesUpdated; 523 //sb[12].StatValue = m_otherMS / framesUpdated;
520 sb[12].StatValue = (float) simulationSumFrameTime / m_numberFramesStored; 524 sb[12].StatValue = (float) simulationSumFrameTime / m_numberFramesStored / m_statisticsFPSfactor;
521 525
522 sb[13].StatID = (uint)Stats.InPacketsPerSecond; 526 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
523 sb[13].StatValue = (m_inPacketsPerSecond / m_statsUpdateFactor); 527 sb[13].StatValue = (m_inPacketsPerSecond / m_statsUpdateFactor);