aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
diff options
context:
space:
mode:
authorMelanie2011-10-12 01:41:28 +0100
committerMelanie2011-10-12 01:41:28 +0100
commite68226afd3fd42f776a330aeb36354411854ea2d (patch)
tree196c1bc78536038a94581d322ea53b06f64cb810 /OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
parentMerge commit '3142982353a121920e571e5b33acffc065b20a2e' into bigmerge (diff)
parentMake reported sim fps more accurate, in line with frame time ms (diff)
downloadopensim-SC-e68226afd3fd42f776a330aeb36354411854ea2d.zip
opensim-SC-e68226afd3fd42f776a330aeb36354411854ea2d.tar.gz
opensim-SC-e68226afd3fd42f776a330aeb36354411854ea2d.tar.bz2
opensim-SC-e68226afd3fd42f776a330aeb36354411854ea2d.tar.xz
Merge commit '7d033187d8fd49d9a38531061c38783e81d69f5b' into bigmerge
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SimStatsReporter.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs29
1 files changed, 13 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 87dcdee..2d92ed8 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -37,6 +37,9 @@ namespace OpenSim.Region.Framework.Scenes
37{ 37{
38 public class SimStatsReporter 38 public class SimStatsReporter
39 { 39 {
40// private static readonly log4net.ILog m_log
41// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42
40 public delegate void SendStatResult(SimStats stats); 43 public delegate void SendStatResult(SimStats stats);
41 44
42 public delegate void YourStatsAreWrong(); 45 public delegate void YourStatsAreWrong();
@@ -165,18 +168,9 @@ namespace OpenSim.Region.Framework.Scenes
165 168
166#region various statistic googly moogly 169#region various statistic googly moogly
167 170
168 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there
169 // 0-50 is pretty close to 0-45
170 float simfps = (int) ((m_fps * 5));
171 // save the reported value so there is something available for llGetRegionFPS 171 // save the reported value so there is something available for llGetRegionFPS
172 lastReportedSimFPS = (float)simfps / statsUpdateFactor; 172 lastReportedSimFPS = (float)m_fps / statsUpdateFactor;
173
174 //if (simfps > 45)
175 //simfps = simfps - (simfps - 45);
176 //if (simfps < 0)
177 //simfps = 0;
178 173
179 //
180 float physfps = ((m_pfps / 1000)); 174 float physfps = ((m_pfps / 1000));
181 175
182 //if (physfps > 600) 176 //if (physfps > 600)
@@ -197,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes
197 // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change 191 // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change
198 // values to X-per-second values. 192 // values to X-per-second values.
199 193
200 for (int i = 0; i<21;i++) 194 for (int i = 0; i < 21; i++)
201 { 195 {
202 sb[i] = new SimStatsPacket.StatBlock(); 196 sb[i] = new SimStatsPacket.StatBlock();
203 } 197 }
@@ -206,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes
206 sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor)); 200 sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
207 201
208 sb[1].StatID = (uint) Stats.SimFPS; 202 sb[1].StatID = (uint) Stats.SimFPS;
209 sb[1].StatValue = simfps/statsUpdateFactor; 203 sb[1].StatValue = m_fps/statsUpdateFactor;
210 204
211 sb[2].StatID = (uint) Stats.PhysicsFPS; 205 sb[2].StatID = (uint) Stats.PhysicsFPS;
212 sb[2].StatValue = physfps / statsUpdateFactor; 206 sb[2].StatValue = physfps / statsUpdateFactor;
@@ -272,7 +266,8 @@ namespace OpenSim.Region.Framework.Scenes
272 266
273 SimStats simStats 267 SimStats simStats
274 = new SimStats( 268 = new SimStats(
275 ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID); 269 ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity,
270 rb, sb, m_scene.RegionInfo.originRegionID);
276 271
277 handlerSendStatResult = OnSendStatsResult; 272 handlerSendStatResult = OnSendStatsResult;
278 if (handlerSendStatResult != null) 273 if (handlerSendStatResult != null)
@@ -395,30 +390,32 @@ namespace OpenSim.Region.Framework.Scenes
395 { 390 {
396 m_frameMS += ms; 391 m_frameMS += ms;
397 } 392 }
393
398 public void addNetMS(int ms) 394 public void addNetMS(int ms)
399 { 395 {
400 m_netMS += ms; 396 m_netMS += ms;
401 } 397 }
398
402 public void addAgentMS(int ms) 399 public void addAgentMS(int ms)
403 { 400 {
404 m_agentMS += ms; 401 m_agentMS += ms;
405 } 402 }
403
406 public void addPhysicsMS(int ms) 404 public void addPhysicsMS(int ms)
407 { 405 {
408 m_physicsMS += ms; 406 m_physicsMS += ms;
409 } 407 }
408
410 public void addImageMS(int ms) 409 public void addImageMS(int ms)
411 { 410 {
412 m_imageMS += ms; 411 m_imageMS += ms;
413 } 412 }
413
414 public void addOtherMS(int ms) 414 public void addOtherMS(int ms)
415 { 415 {
416 m_otherMS += ms; 416 m_otherMS += ms;
417 } 417 }
418 418
419// private static readonly log4net.ILog m_log
420// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
421
422 public void AddPendingDownloads(int count) 419 public void AddPendingDownloads(int count)
423 { 420 {
424 m_pendingDownloads += count; 421 m_pendingDownloads += count;