diff options
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | 103 |
1 files changed, 42 insertions, 61 deletions
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 | } |