aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs48
2 files changed, 52 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 749b281..f7c6413 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2509,21 +2509,21 @@ namespace OpenSim.Region.Framework.Scenes
2509 { 2509 {
2510 } 2510 }
2511 2511
2512 private bool CollisionFilteredOut(SceneObjectPart dest, UUID objectID, string objectName) 2512 public bool CollisionFilteredOut(UUID objectID, string objectName)
2513 { 2513 {
2514 if(dest.CollisionFilter.Count == 0) 2514 if(CollisionFilter.Count == 0)
2515 return false; 2515 return false;
2516 2516
2517 if (dest.CollisionFilter.ContainsValue(objectID.ToString()) || 2517 if (CollisionFilter.ContainsValue(objectID.ToString()) ||
2518 dest.CollisionFilter.ContainsValue(objectID.ToString() + objectName) || 2518 CollisionFilter.ContainsValue(objectID.ToString() + objectName) ||
2519 dest.CollisionFilter.ContainsValue(UUID.Zero.ToString() + objectName)) 2519 CollisionFilter.ContainsValue(UUID.Zero.ToString() + objectName))
2520 { 2520 {
2521 if (dest.CollisionFilter.ContainsKey(1)) 2521 if (CollisionFilter.ContainsKey(1))
2522 return false; 2522 return false;
2523 return true; 2523 return true;
2524 } 2524 }
2525 2525
2526 if (dest.CollisionFilter.ContainsKey(1)) 2526 if (CollisionFilter.ContainsKey(1))
2527 return true; 2527 return true;
2528 2528
2529 return false; 2529 return false;
@@ -2586,7 +2586,7 @@ namespace OpenSim.Region.Framework.Scenes
2586 SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId); 2586 SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId);
2587 if (obj != null) 2587 if (obj != null)
2588 { 2588 {
2589 if (!dest.CollisionFilteredOut(this, obj.UUID, obj.Name)) 2589 if (!dest.CollisionFilteredOut(obj.UUID, obj.Name))
2590 colliding.Add(CreateDetObject(obj)); 2590 colliding.Add(CreateDetObject(obj));
2591 } 2591 }
2592 else 2592 else
@@ -2594,7 +2594,7 @@ namespace OpenSim.Region.Framework.Scenes
2594 ScenePresence av = ParentGroup.Scene.GetScenePresence(localId); 2594 ScenePresence av = ParentGroup.Scene.GetScenePresence(localId);
2595 if (av != null && (!av.IsChildAgent)) 2595 if (av != null && (!av.IsChildAgent))
2596 { 2596 {
2597 if (!dest.CollisionFilteredOut(this, av.UUID, av.Name)) 2597 if (!dest.CollisionFilteredOut(av.UUID, av.Name))
2598 colliding.Add(CreateDetObject(av)); 2598 colliding.Add(CreateDetObject(av));
2599 } 2599 }
2600 } 2600 }
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index a4afd47..cb102d0 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -26,7 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29//using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Timers; 30using System.Timers;
31using OpenMetaverse.Packets; 31using OpenMetaverse.Packets;
32using OpenSim.Framework; 32using OpenSim.Framework;
@@ -35,10 +35,18 @@ using OpenSim.Region.Framework.Interfaces;
35 35
36namespace OpenSim.Region.Framework.Scenes 36namespace OpenSim.Region.Framework.Scenes
37{ 37{
38 /// <summary>
39 /// Collect statistics from the scene to send to the client and for access by other monitoring tools.
40 /// </summary>
41 /// <remarks>
42 /// FIXME: This should be a monitoring region module
43 /// </remarks>
38 public class SimStatsReporter 44 public class SimStatsReporter
39 { 45 {
40// private static readonly log4net.ILog m_log 46 private static readonly log4net.ILog m_log
41// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 47 = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48
49 public const string LastReportedObjectUpdateStatName = "LastReportedObjectUpdates";
42 50
43 public delegate void SendStatResult(SimStats stats); 51 public delegate void SendStatResult(SimStats stats);
44 52
@@ -113,6 +121,14 @@ namespace OpenSim.Region.Framework.Scenes
113 get { return lastReportedSimStats; } 121 get { return lastReportedSimStats; }
114 } 122 }
115 123
124 /// <summary>
125 /// Extra sim statistics that are used by monitors but not sent to the client.
126 /// </summary>
127 /// <value>
128 /// The keys are the stat names.
129 /// </value>
130 private Dictionary<string, float> m_lastReportedExtraSimStats = new Dictionary<string, float>();
131
116 // Sending a stats update every 3 seconds- 132 // Sending a stats update every 3 seconds-
117 private int statsUpdatesEveryMS = 3000; 133 private int statsUpdatesEveryMS = 3000;
118 private float statsUpdateFactor = 0; 134 private float statsUpdateFactor = 0;
@@ -387,7 +403,20 @@ namespace OpenSim.Region.Framework.Scenes
387 } 403 }
388 404
389 // Extra statistics that aren't currently sent to clients 405 // Extra statistics that aren't currently sent to clients
390 LastReportedObjectUpdates = m_objectUpdates / statsUpdateFactor; 406 lock (m_lastReportedExtraSimStats)
407 {
408 m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / statsUpdateFactor;
409
410 Dictionary<string, float> physicsStats = m_scene.PhysicsScene.GetStats();
411
412 if (physicsStats != null)
413 {
414 foreach (KeyValuePair<string, float> tuple in physicsStats)
415 {
416 m_lastReportedExtraSimStats[tuple.Key] = tuple.Value / statsUpdateFactor;
417 }
418 }
419 }
391 420
392 resetvalues(); 421 resetvalues();
393 } 422 }
@@ -546,7 +575,10 @@ namespace OpenSim.Region.Framework.Scenes
546 public void AddPendingDownloads(int count) 575 public void AddPendingDownloads(int count)
547 { 576 {
548 m_pendingDownloads += count; 577 m_pendingDownloads += count;
549 if (m_pendingDownloads < 0) m_pendingDownloads = 0; 578
579 if (m_pendingDownloads < 0)
580 m_pendingDownloads = 0;
581
550 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); 582 //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads);
551 } 583 }
552 584
@@ -568,5 +600,11 @@ namespace OpenSim.Region.Framework.Scenes
568 } 600 }
569 601
570 #endregion 602 #endregion
603
604 public Dictionary<string, float> GetExtraSimStats()
605 {
606 lock (m_lastReportedExtraSimStats)
607 return new Dictionary<string, float>(m_lastReportedExtraSimStats);
608 }
571 } 609 }
572} 610}