aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2015-09-06 00:32:20 +0100
committerUbitUmarov2015-09-06 00:32:20 +0100
commit0ddcc55166961d6e10b0250fc521c0663fedd250 (patch)
tree78b44b518abe6ce766453b84c9bf8b89a85469f1 /OpenSim
parentfix modifing m_threads on a foreach scanning it (diff)
downloadopensim-SC-0ddcc55166961d6e10b0250fc521c0663fedd250.zip
opensim-SC-0ddcc55166961d6e10b0250fc521c0663fedd250.tar.gz
opensim-SC-0ddcc55166961d6e10b0250fc521c0663fedd250.tar.bz2
opensim-SC-0ddcc55166961d6e10b0250fc521c0663fedd250.tar.xz
let extra stats travel side by side with viewers ones... try to fix damm array indexes all over the place
Diffstat (limited to 'OpenSim')
-rwxr-xr-xOpenSim/Framework/Monitoring/SimExtraStatsCollector.cs28
-rw-r--r--OpenSim/Framework/SimStats.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs2
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SimStatsReporter.cs141
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs2
5 files changed, 123 insertions, 64 deletions
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
index b0fdc81..08c2409 100755
--- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
@@ -34,6 +34,7 @@ using OpenMetaverse;
34using OpenMetaverse.StructuredData; 34using OpenMetaverse.StructuredData;
35using OpenSim.Framework.Monitoring.Interfaces; 35using OpenSim.Framework.Monitoring.Interfaces;
36 36
37
37namespace OpenSim.Framework.Monitoring 38namespace OpenSim.Framework.Monitoring
38{ 39{
39 /// <summary> 40 /// <summary>
@@ -71,6 +72,11 @@ namespace OpenSim.Framework.Monitoring
71 private volatile float pendingDownloads; 72 private volatile float pendingDownloads;
72 private volatile float pendingUploads; 73 private volatile float pendingUploads;
73 private volatile float activeScripts; 74 private volatile float activeScripts;
75 private volatile float spareTime;
76 private volatile float sleepTime;
77 private volatile float physicsStep;
78
79
74 private volatile float scriptLinesPerSecond; 80 private volatile float scriptLinesPerSecond;
75 private volatile float m_frameDilation; 81 private volatile float m_frameDilation;
76 private volatile float m_usersLoggingIn; 82 private volatile float m_usersLoggingIn;
@@ -253,7 +259,7 @@ namespace OpenSim.Framework.Monitoring
253 /// <param name="pack"></param> 259 /// <param name="pack"></param>
254 public void ReceiveClassicSimStatsPacket(SimStats stats) 260 public void ReceiveClassicSimStatsPacket(SimStats stats)
255 { 261 {
256 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original 262 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original
257 // SimStatsPacket that was being used). 263 // SimStatsPacket that was being used).
258 264
259 // For an unknown reason the original designers decided not to 265 // For an unknown reason the original designers decided not to
@@ -270,8 +276,8 @@ namespace OpenSim.Framework.Monitoring
270 totalFrameTime = stats.StatsBlock[8].StatValue; 276 totalFrameTime = stats.StatsBlock[8].StatValue;
271 netFrameTime = stats.StatsBlock[9].StatValue; 277 netFrameTime = stats.StatsBlock[9].StatValue;
272 physicsFrameTime = stats.StatsBlock[10].StatValue; 278 physicsFrameTime = stats.StatsBlock[10].StatValue;
273 otherFrameTime = stats.StatsBlock[11].StatValue; 279 imageFrameTime = stats.StatsBlock[11].StatValue;
274 imageFrameTime = stats.StatsBlock[12].StatValue; 280 otherFrameTime = stats.StatsBlock[12].StatValue;
275 inPacketsPerSecond = stats.StatsBlock[13].StatValue; 281 inPacketsPerSecond = stats.StatsBlock[13].StatValue;
276 outPacketsPerSecond = stats.StatsBlock[14].StatValue; 282 outPacketsPerSecond = stats.StatsBlock[14].StatValue;
277 unackedBytes = stats.StatsBlock[15].StatValue; 283 unackedBytes = stats.StatsBlock[15].StatValue;
@@ -279,12 +285,16 @@ namespace OpenSim.Framework.Monitoring
279 pendingDownloads = stats.StatsBlock[17].StatValue; 285 pendingDownloads = stats.StatsBlock[17].StatValue;
280 pendingUploads = stats.StatsBlock[18].StatValue; 286 pendingUploads = stats.StatsBlock[18].StatValue;
281 activeScripts = stats.StatsBlock[19].StatValue; 287 activeScripts = stats.StatsBlock[19].StatValue;
282 scriptLinesPerSecond = stats.StatsBlock[20].StatValue; 288 sleepTime = stats.StatsBlock[20].StatValue;
283 m_frameDilation = stats.StatsBlock[22].StatValue; 289 spareTime = stats.StatsBlock[21].StatValue;
284// m_usersLoggingIn = stats.StatsBlock[23].StatValue; 290 physicsStep = stats.StatsBlock[22].StatValue;
285// m_totalGeoPrims = stats.StatsBlock[24].StatValue; 291
286// m_totalMeshes = stats.StatsBlock[25].StatValue; 292 scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue;
287// m_inUseThreads = stats.StatsBlock[26].StatValue; 293 m_frameDilation = stats.ExtraStatsBlock[1].StatValue;
294 m_usersLoggingIn = stats.ExtraStatsBlock[2].StatValue;
295 m_totalGeoPrims = stats.ExtraStatsBlock[3].StatValue;
296 m_totalMeshes = stats.ExtraStatsBlock[4].StatValue;
297 m_inUseThreads = stats.ExtraStatsBlock[5].StatValue;
288 } 298 }
289 299
290 /// <summary> 300 /// <summary>
diff --git a/OpenSim/Framework/SimStats.cs b/OpenSim/Framework/SimStats.cs
index 3d8f32f..a811187 100644
--- a/OpenSim/Framework/SimStats.cs
+++ b/OpenSim/Framework/SimStats.cs
@@ -55,13 +55,19 @@ namespace OpenSim.Framework
55 get { return m_regionBlock; } 55 get { return m_regionBlock; }
56 } 56 }
57 private SimStatsPacket.RegionBlock m_regionBlock; 57 private SimStatsPacket.RegionBlock m_regionBlock;
58 58
59 public SimStatsPacket.StatBlock[] StatsBlock 59 public SimStatsPacket.StatBlock[] StatsBlock
60 { 60 {
61 get { return m_statsBlock; } 61 get { return m_statsBlock; }
62 } 62 }
63 private SimStatsPacket.StatBlock[] m_statsBlock; 63 private SimStatsPacket.StatBlock[] m_statsBlock;
64 64
65 public SimStatsPacket.StatBlock[] ExtraStatsBlock
66 {
67 get { return m_extraStatsBlock; }
68 }
69 private SimStatsPacket.StatBlock[] m_extraStatsBlock;
70
65 public uint RegionFlags 71 public uint RegionFlags
66 { 72 {
67 get { return m_regionFlags; } 73 get { return m_regionFlags; }
@@ -82,7 +88,8 @@ namespace OpenSim.Framework
82 88
83 public SimStats( 89 public SimStats(
84 uint regionX, uint regionY, uint regionFlags, uint objectCapacity, 90 uint regionX, uint regionY, uint regionFlags, uint objectCapacity,
85 SimStatsPacket.RegionBlock regionBlock, SimStatsPacket.StatBlock[] statsBlock, UUID pRUUID) 91 SimStatsPacket.RegionBlock regionBlock, SimStatsPacket.StatBlock[] statsBlock,
92 SimStatsPacket.StatBlock[] ExtraStatsBlock, UUID pRUUID)
86 { 93 {
87 regionUUID = pRUUID; 94 regionUUID = pRUUID;
88 m_regionX = regionX; 95 m_regionX = regionX;
@@ -91,6 +98,7 @@ namespace OpenSim.Framework
91 m_objectCapacity = objectCapacity; 98 m_objectCapacity = objectCapacity;
92 m_regionBlock = regionBlock; 99 m_regionBlock = regionBlock;
93 m_statsBlock = statsBlock; 100 m_statsBlock = statsBlock;
101 m_extraStatsBlock = ExtraStatsBlock;
94 } 102 }
95 } 103 }
96} 104}
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
index f1d4756..ae1fc60 100644
--- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
@@ -301,7 +301,7 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
301 m_scene, 301 m_scene,
302 "SpareFrameTimeMonitor", 302 "SpareFrameTimeMonitor",
303 "Spare Frame Time", 303 "Spare Frame Time",
304 m => m.Scene.StatsReporter.LastReportedSimStats[21], 304 m => m.Scene.StatsReporter.LastReportedSimStats[37],
305 m => string.Format("{0} ms", m.GetValue()))); 305 m => string.Format("{0} ms", m.GetValue())));
306 306
307 m_alerts.Add(new DeadlockAlert(m_staticMonitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); 307 m_alerts.Add(new DeadlockAlert(m_staticMonitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor));
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index b964317..462e8a6 100755
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -63,10 +63,9 @@ namespace OpenSim.Region.Framework.Scenes
63 63
64 // Determines the size of the array that is used to collect StatBlocks 64 // Determines the size of the array that is used to collect StatBlocks
65 // for sending viewer compatible stats must be conform with sb array filling below 65 // for sending viewer compatible stats must be conform with sb array filling below
66 private const int m_statisticViewerArraySize = 23; 66 private const int m_statisticViewerArraySize = 37;
67 // size of LastReportedSimFPS with extra stats. 67 // size of LastReportedSimFPS with extra stats.
68 private const int m_statisticExtraArraySize = m_statisticViewerArraySize + 68 private const int m_statisticExtraArraySize = (int)(Stats.SimExtraCountEnd - Stats.SimExtraCountStart);
69 (int)(Stats.SimExtraCountEnd - Stats.SimExtraCountStart);
70 69
71 /// <summary> 70 /// <summary>
72 /// These are the IDs of stats sent in the StatsPacket to the viewer. 71 /// These are the IDs of stats sent in the StatsPacket to the viewer.
@@ -196,7 +195,7 @@ namespace OpenSim.Region.Framework.Scenes
196 195
197 // saved last reported value so there is something available for llGetRegionFPS 196 // saved last reported value so there is something available for llGetRegionFPS
198 private float lastReportedSimFPS; 197 private float lastReportedSimFPS;
199 private float[] lastReportedSimStats = new float[m_statisticExtraArraySize]; 198 private float[] lastReportedSimStats = new float[m_statisticExtraArraySize + m_statisticViewerArraySize];
200 private float m_pfps; 199 private float m_pfps;
201 200
202 /// <summary> 201 /// <summary>
@@ -234,28 +233,7 @@ namespace OpenSim.Region.Framework.Scenes
234 233
235 private int m_objectCapacity = 45000; 234 private int m_objectCapacity = 45000;
236 235
237 // This is the number of frames that will be stored and then averaged for 236 // The current number of users attempting to login to the region
238 // the Total, Simulation, Physics, and Network Frame Time; It is set to
239 // 10 by default but can be changed by the OpenSim.ini configuration file
240 // NumberOfFrames parameter
241 private int m_numberFramesStored;
242
243 // The arrays that will hold the time it took to run the past N frames,
244 // where N is the num_frames_to_average given by the configuration file
245 private double[] m_totalFrameTimeMilliseconds;
246 private double[] m_simulationFrameTimeMilliseconds;
247 private double[] m_physicsFrameTimeMilliseconds;
248 private double[] m_networkFrameTimeMilliseconds;
249
250 // The location of the next time in milliseconds that will be
251 // (over)written when the next frame completes
252 private int m_nextLocation = 0;
253
254 // The correct number of frames that have completed since the last stats
255 // update for physics
256 private int m_numberPhysicsFrames;
257
258 // The current number of users attempting to login to the region
259 private int m_usersLoggingIn; 237 private int m_usersLoggingIn;
260 238
261 // The last reported value of threads from the SmartThreadPool inside of 239 // The last reported value of threads from the SmartThreadPool inside of
@@ -339,18 +317,12 @@ namespace OpenSim.Region.Framework.Scenes
339 317
340 private void statsHeartBeat(object sender, EventArgs e) 318 private void statsHeartBeat(object sender, EventArgs e)
341 { 319 {
342 double totalSumFrameTime; 320 if (!m_scene.Active)
343 double simulationSumFrameTime;
344 double physicsSumFrameTime;
345 double networkSumFrameTime;
346 float frameDilation;
347 int currentFrame;
348
349 if (!m_scene.Active)
350 return; 321 return;
351 322
352 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[m_statisticViewerArraySize]; 323 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[m_statisticViewerArraySize];
353 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 324 SimStatsPacket.StatBlock[] sbex = new SimStatsPacket.StatBlock[m_statisticExtraArraySize];
325 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
354 326
355 // Know what's not thread safe in Mono... modifying timers. 327 // Know what's not thread safe in Mono... modifying timers.
356 // m_log.Debug("Firing Stats Heart Beat"); 328 // m_log.Debug("Firing Stats Heart Beat");
@@ -431,7 +403,7 @@ namespace OpenSim.Region.Framework.Scenes
431 if (m_otherMS < 0) 403 if (m_otherMS < 0)
432 m_otherMS = 0; 404 m_otherMS = 0;
433 405
434 for (int i = 0; i < 23; i++) 406 for (int i = 0; i < m_statisticViewerArraySize; i++)
435 { 407 {
436 sb[i] = new SimStatsPacket.StatBlock(); 408 sb[i] = new SimStatsPacket.StatBlock();
437 } 409 }
@@ -506,25 +478,95 @@ namespace OpenSim.Region.Framework.Scenes
506 sb[22].StatID = (uint)Stats.SimPhysicsStepMs; 478 sb[22].StatID = (uint)Stats.SimPhysicsStepMs;
507 sb[22].StatValue = 20; 479 sb[22].StatValue = 20;
508 480
509 for (int i = 0; i < 23; i++) 481 // send the ones we dont have as zeros, to clean viewers state
482 // specially arriving from regions with wrond IDs in use
483
484 sb[23].StatID = (uint)Stats.VirtualSizeKb;
485 sb[23].StatValue = 0;
486
487 sb[24].StatID = (uint)Stats.ResidentSizeKb;
488 sb[24].StatValue = 0;
489
490 sb[25].StatID = (uint)Stats.PendingLocalUploads;
491 sb[25].StatValue = 0;
492
493 sb[26].StatID = (uint)Stats.PhysicsPinnedTasks;
494 sb[26].StatValue = 0;
495
496 sb[27].StatID = (uint)Stats.PhysicsLodTasks;
497 sb[27].StatValue = 0;
498
499 sb[28].StatID = (uint)Stats.ScriptEps; // we should have this
500 sb[28].StatValue = 0;
501
502 sb[29].StatID = (uint)Stats.SimAIStepTimeMS;
503 sb[29].StatValue = 0;
504
505 sb[30].StatID = (uint)Stats.SimIoPumpTime;
506 sb[30].StatValue = 0;
507
508 sb[31].StatID = (uint)Stats.SimPCTSscriptsRun;
509 sb[31].StatValue = 0;
510
511 sb[32].StatID = (uint)Stats.SimRegionIdle;
512 sb[32].StatValue = 0;
513
514 sb[33].StatID = (uint)Stats.SimRegionIdlePossible;
515 sb[33].StatValue = 0;
516
517 sb[34].StatID = (uint)Stats.SimSkippedSillouet_PS;
518 sb[34].StatValue = 0;
519
520 sb[35].StatID = (uint)Stats.SimSkippedCharsPerC;
521 sb[35].StatValue = 0;
522
523 sb[36].StatID = (uint)Stats.SimPhysicsMemory;
524 sb[36].StatValue = 0;
525
526
527 for (int i = 0; i < 37; i++)
510 { 528 {
511 lastReportedSimStats[i] = sb[i].StatValue; 529 lastReportedSimStats[i] = sb[i].StatValue;
512 } 530 }
513 531
532
533 // add extra stats for internal use
534
535 for (int i = 0; i < m_statisticExtraArraySize; i++)
536 {
537 sbex[i] = new SimStatsPacket.StatBlock();
538 }
539
540 sbex[0].StatID = (uint)Stats.LSLScriptLinesPerSecond;
541 sbex[0].StatValue = m_scriptLinesPerSecond * updateFactor;
542 lastReportedSimStats[37] = m_scriptLinesPerSecond * updateFactor;
543
544 sbex[1].StatID = (uint)Stats.FrameDilation2;
545 sbex[1].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation;
546 lastReportedSimStats[38] = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation;
547
548 sbex[2].StatID = (uint)Stats.UsersLoggingIn;
549 sbex[2].StatValue = m_usersLoggingIn;
550 lastReportedSimStats[39] = m_usersLoggingIn;
551
552 sbex[3].StatID = (uint)Stats.TotalGeoPrim;
553 sbex[3].StatValue = m_numGeoPrim;
554 lastReportedSimStats[40] = m_numGeoPrim;
555
556 sbex[4].StatID = (uint)Stats.TotalMesh;
557 sbex[4].StatValue = m_numMesh;
558 lastReportedSimStats[41] = m_numMesh;
559
560 sbex[5].StatID = (uint)Stats.ThreadCount;
561 sbex[5].StatValue = m_inUseThreads;
562 lastReportedSimStats[42] = m_inUseThreads;
563
514 SimStats simStats 564 SimStats simStats
515 = new SimStats( 565 = new SimStats(
516 ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, 566 ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity,
517 rb, sb, m_scene.RegionInfo.originRegionID); 567 rb, sb, sbex, m_scene.RegionInfo.originRegionID);
518 568
519 // add extra stats for internal use 569 handlerSendStatResult = OnSendStatsResult;
520 lastReportedSimStats[23] = m_scriptLinesPerSecond * updateFactor;
521 lastReportedSimStats[24] = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation;
522 lastReportedSimStats[24] = m_usersLoggingIn;
523 lastReportedSimStats[25] = m_numGeoPrim;
524 lastReportedSimStats[26] = m_numMesh;
525 lastReportedSimStats[27] = m_inUseThreads;
526
527 handlerSendStatResult = OnSendStatsResult;
528 if (handlerSendStatResult != null) 570 if (handlerSendStatResult != null)
529 { 571 {
530 handlerSendStatResult(simStats); 572 handlerSendStatResult(simStats);
@@ -565,7 +607,6 @@ namespace OpenSim.Region.Framework.Scenes
565 { 607 {
566 // Reset the number of frames that the physics library has 608 // Reset the number of frames that the physics library has
567 // processed since the last stats report 609 // processed since the last stats report
568 m_numberPhysicsFrames = 0;
569 610
570 m_timeDilation = 0; 611 m_timeDilation = 0;
571 m_fps = 0; 612 m_fps = 0;
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 1383208..8ccb751 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -1200,7 +1200,7 @@ VALUES
1200 m_pendingDownloads = stats.StatsBlock[17].StatValue; 1200 m_pendingDownloads = stats.StatsBlock[17].StatValue;
1201 m_pendingUploads = stats.StatsBlock[18].StatValue; 1201 m_pendingUploads = stats.StatsBlock[18].StatValue;
1202 m_activeScripts = stats.StatsBlock[19].StatValue; 1202 m_activeScripts = stats.StatsBlock[19].StatValue;
1203 m_scriptLinesPerSecond = stats.StatsBlock[20].StatValue; 1203 m_scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue;
1204 } 1204 }
1205 } 1205 }
1206} \ No newline at end of file 1206} \ No newline at end of file