diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs | 40 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | 103 |
2 files changed, 57 insertions, 86 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 1ee6f0d..0c6cb1b 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs | |||
@@ -32,7 +32,6 @@ using System.Net; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
36 | using Nini.Config; | 35 | using Nini.Config; |
37 | using OpenMetaverse; | 36 | using OpenMetaverse; |
38 | using OpenMetaverse.Packets; | 37 | using OpenMetaverse.Packets; |
@@ -53,13 +52,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
53 | public OSDMap body; | 52 | public OSDMap body; |
54 | } | 53 | } |
55 | 54 | ||
56 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 55 | public class EventQueueGetModule : IEventQueue, IRegionModule |
57 | public class EventQueueGetModule : IEventQueue, INonSharedRegionModule | ||
58 | { | 56 | { |
59 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 57 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
60 | protected Scene m_scene = null; | 58 | protected Scene m_scene = null; |
61 | private IConfigSource m_gConfig; | 59 | private IConfigSource m_gConfig; |
62 | private IConfig m_startupConfig; | ||
63 | bool enabledYN = false; | 60 | bool enabledYN = false; |
64 | 61 | ||
65 | private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); | 62 | private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); |
@@ -68,31 +65,23 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
68 | private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>(); | 65 | private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>(); |
69 | private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>(); | 66 | private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>(); |
70 | 67 | ||
71 | #region INonSharedRegionModule methods | 68 | #region IRegionModule methods |
72 | public virtual void Initialise(IConfigSource config) | 69 | public virtual void Initialise(Scene scene, IConfigSource config) |
73 | { | 70 | { |
74 | m_gConfig = config; | 71 | m_gConfig = config; |
75 | 72 | ||
76 | m_startupConfig = m_gConfig.Configs["Startup"]; | 73 | IConfig startupConfig = m_gConfig.Configs["Startup"]; |
77 | } | ||
78 | 74 | ||
79 | public Type ReplaceableInterface | 75 | ReadConfigAndPopulate(scene, startupConfig, "Startup"); |
80 | { | ||
81 | get { return null; } | ||
82 | } | ||
83 | |||
84 | public void AddRegion(Scene scene) | ||
85 | { | ||
86 | ReadConfigAndPopulate(scene, m_startupConfig, "Startup"); | ||
87 | 76 | ||
88 | if (enabledYN) | 77 | if (enabledYN) |
89 | { | 78 | { |
90 | m_scene = scene; | 79 | m_scene = scene; |
91 | scene.RegisterModuleInterface<IEventQueue>(this); | 80 | scene.RegisterModuleInterface<IEventQueue>(this); |
92 | 81 | ||
93 | // Register fallback handler | 82 | // Register fallback handler |
94 | // Why does EQG Fail on region crossings! | 83 | // Why does EQG Fail on region crossings! |
95 | 84 | ||
96 | //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); | 85 | //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); |
97 | 86 | ||
98 | scene.EventManager.OnNewClient += OnNewClient; | 87 | scene.EventManager.OnNewClient += OnNewClient; |
@@ -110,19 +99,16 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
110 | { | 99 | { |
111 | m_gConfig = null; | 100 | m_gConfig = null; |
112 | } | 101 | } |
102 | |||
113 | } | 103 | } |
114 | 104 | ||
115 | public void RegionLoaded(Scene scene) | 105 | private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) |
116 | { | ||
117 | } | ||
118 | |||
119 | public void RemoveRegion(Scene scene) | ||
120 | { | 106 | { |
107 | enabledYN = startupConfig.GetBoolean("EventQueue", true); | ||
121 | } | 108 | } |
122 | 109 | ||
123 | private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) | 110 | public void PostInitialise() |
124 | { | 111 | { |
125 | enabledYN = startupConfig.GetBoolean("EventQueue", true); | ||
126 | } | 112 | } |
127 | 113 | ||
128 | public virtual void Close() | 114 | public virtual void Close() |
@@ -134,6 +120,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
134 | get { return "EventQueueGetModule"; } | 120 | get { return "EventQueueGetModule"; } |
135 | } | 121 | } |
136 | 122 | ||
123 | public bool IsSharedModule | ||
124 | { | ||
125 | get { return false; } | ||
126 | } | ||
137 | #endregion | 127 | #endregion |
138 | 128 | ||
139 | /// <summary> | 129 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 0135d33..f15f8f6 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | |||
@@ -25,12 +25,10 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | using System.Collections; | 28 | using System.Collections; |
30 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
31 | using System.Reflection; | 30 | using System.Reflection; |
32 | using log4net; | 31 | using log4net; |
33 | using Mono.Addins; | ||
34 | using Nini.Config; | 32 | using Nini.Config; |
35 | using OpenMetaverse; | 33 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
@@ -41,8 +39,7 @@ using OpenSim.Region.Framework.Scenes; | |||
41 | 39 | ||
42 | namespace OpenSim.Region.CoreModules.Framework.Monitoring | 40 | namespace OpenSim.Region.CoreModules.Framework.Monitoring |
43 | { | 41 | { |
44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 42 | public class MonitorModule : IRegionModule |
45 | public class MonitorModule : INonSharedRegionModule | ||
46 | { | 43 | { |
47 | private Scene m_scene; | 44 | private Scene m_scene; |
48 | private readonly List<IMonitor> m_monitors = new List<IMonitor>(); | 45 | private readonly List<IMonitor> m_monitors = new List<IMonitor>(); |
@@ -65,19 +62,9 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
65 | } | 62 | } |
66 | } | 63 | } |
67 | 64 | ||
68 | #region Implementation of INonSharedRegionModule | 65 | #region Implementation of IRegionModule |
69 | 66 | ||
70 | public void Initialise(IConfigSource source) | 67 | public void Initialise(Scene scene, IConfigSource source) |
71 | { | ||
72 | |||
73 | } | ||
74 | |||
75 | public Type ReplaceableInterface | ||
76 | { | ||
77 | get { return null; } | ||
78 | } | ||
79 | |||
80 | public void AddRegion(Scene scene) | ||
81 | { | 68 | { |
82 | m_scene = scene; | 69 | m_scene = scene; |
83 | 70 | ||
@@ -90,51 +77,6 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
90 | MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); | 77 | MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); |
91 | } | 78 | } |
92 | 79 | ||
93 | public void RegionLoaded(Scene scene) | ||
94 | { | ||
95 | m_monitors.Add(new AgentCountMonitor(m_scene)); | ||
96 | m_monitors.Add(new ChildAgentCountMonitor(m_scene)); | ||
97 | m_monitors.Add(new GCMemoryMonitor()); | ||
98 | m_monitors.Add(new ObjectCountMonitor(m_scene)); | ||
99 | m_monitors.Add(new PhysicsFrameMonitor(m_scene)); | ||
100 | m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); | ||
101 | m_monitors.Add(new PWSMemoryMonitor()); | ||
102 | m_monitors.Add(new ThreadCountMonitor()); | ||
103 | m_monitors.Add(new TotalFrameMonitor(m_scene)); | ||
104 | m_monitors.Add(new EventFrameMonitor(m_scene)); | ||
105 | m_monitors.Add(new LandFrameMonitor(m_scene)); | ||
106 | m_monitors.Add(new LastFrameTimeMonitor(m_scene)); | ||
107 | |||
108 | m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); | ||
109 | |||
110 | foreach (IAlert alert in m_alerts) | ||
111 | { | ||
112 | alert.OnTriggerAlert += OnTriggerAlert; | ||
113 | } | ||
114 | } | ||
115 | |||
116 | public void RemoveRegion(Scene scene) | ||
117 | { | ||
118 | MainServer.Instance.RemoveHTTPHandler("", "/monitorstats/" + m_scene.RegionInfo.RegionID + "/"); | ||
119 | m_monitors.Clear(); | ||
120 | |||
121 | foreach (IAlert alert in m_alerts) | ||
122 | { | ||
123 | alert.OnTriggerAlert -= OnTriggerAlert; | ||
124 | } | ||
125 | m_alerts.Clear(); | ||
126 | } | ||
127 | |||
128 | public void Close() | ||
129 | { | ||
130 | |||
131 | } | ||
132 | |||
133 | public string Name | ||
134 | { | ||
135 | get { return "Region Health Monitoring Module"; } | ||
136 | } | ||
137 | |||
138 | public Hashtable StatsPage(Hashtable request) | 80 | public Hashtable StatsPage(Hashtable request) |
139 | { | 81 | { |
140 | // If request was for a specific monitor | 82 | // If request was for a specific monitor |
@@ -190,10 +132,49 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
190 | return ereply; | 132 | return ereply; |
191 | } | 133 | } |
192 | 134 | ||
135 | public void PostInitialise() | ||
136 | { | ||
137 | m_monitors.Add(new AgentCountMonitor(m_scene)); | ||
138 | m_monitors.Add(new ChildAgentCountMonitor(m_scene)); | ||
139 | m_monitors.Add(new GCMemoryMonitor()); | ||
140 | m_monitors.Add(new ObjectCountMonitor(m_scene)); | ||
141 | m_monitors.Add(new PhysicsFrameMonitor(m_scene)); | ||
142 | m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); | ||
143 | m_monitors.Add(new PWSMemoryMonitor()); | ||
144 | m_monitors.Add(new ThreadCountMonitor()); | ||
145 | m_monitors.Add(new TotalFrameMonitor(m_scene)); | ||
146 | m_monitors.Add(new EventFrameMonitor(m_scene)); | ||
147 | m_monitors.Add(new LandFrameMonitor(m_scene)); | ||
148 | m_monitors.Add(new LastFrameTimeMonitor(m_scene)); | ||
149 | |||
150 | m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); | ||
151 | |||
152 | foreach (IAlert alert in m_alerts) | ||
153 | { | ||
154 | alert.OnTriggerAlert += OnTriggerAlert; | ||
155 | } | ||
156 | } | ||
157 | |||
193 | void OnTriggerAlert(System.Type reporter, string reason, bool fatal) | 158 | void OnTriggerAlert(System.Type reporter, string reason, bool fatal) |
194 | { | 159 | { |
195 | m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")"); | 160 | m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")"); |
196 | } | 161 | } |
162 | |||
163 | public void Close() | ||
164 | { | ||
165 | |||
166 | } | ||
167 | |||
168 | public string Name | ||
169 | { | ||
170 | get { return "Region Health Monitoring Module"; } | ||
171 | } | ||
172 | |||
173 | public bool IsSharedModule | ||
174 | { | ||
175 | get { return false; } | ||
176 | } | ||
177 | |||
197 | #endregion | 178 | #endregion |
198 | } | 179 | } |
199 | } | 180 | } |