diff options
author | Adam Frisby | 2009-11-01 19:37:40 +1100 |
---|---|---|
committer | Adam Frisby | 2009-11-01 19:37:40 +1100 |
commit | 711dde34e4e5da954a58393e1a177e8c6969b8b5 (patch) | |
tree | a1411439bd3a5a897626d640dfd540bae26c9545 /OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | |
parent | Patch + minor formatting fixes. (diff) | |
download | opensim-SC_OLD-711dde34e4e5da954a58393e1a177e8c6969b8b5.zip opensim-SC_OLD-711dde34e4e5da954a58393e1a177e8c6969b8b5.tar.gz opensim-SC_OLD-711dde34e4e5da954a58393e1a177e8c6969b8b5.tar.bz2 opensim-SC_OLD-711dde34e4e5da954a58393e1a177e8c6969b8b5.tar.xz |
* Implements new 'Monitoring' system for reporting performance.
* Mostly the same set as the StatsMonitor used for Viewer notification, but exposes some new frametimes - including EventMS, PhysicsUpdateMS, LandUpdateMS; new memory monitoring - both GC.TotalMemory and Process.PrivateWorkingMemory64; also exposes ThreadCount (using System.Diagnostics.Process)
* Type 'monitor report' on the console to see output.
* SNMP Implementation forthcoming.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs new file mode 100644 index 0000000..d4a7692 --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | |||
@@ -0,0 +1,70 @@ | |||
1 | using System.Collections.Generic; | ||
2 | using System.Reflection; | ||
3 | using log4net; | ||
4 | using Nini.Config; | ||
5 | using OpenSim.Region.CoreModules.Framework.Monitoring.Monitors; | ||
6 | using OpenSim.Region.Framework.Interfaces; | ||
7 | using OpenSim.Region.Framework.Scenes; | ||
8 | |||
9 | namespace OpenSim.Region.CoreModules.Framework.Monitoring | ||
10 | { | ||
11 | public class MonitorModule : IRegionModule | ||
12 | { | ||
13 | private Scene m_scene; | ||
14 | private readonly List<IMonitor> m_monitors = new List<IMonitor>(); | ||
15 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
16 | |||
17 | public void DebugMonitors(string module, string[] args) | ||
18 | { | ||
19 | foreach (IMonitor monitor in m_monitors) | ||
20 | { | ||
21 | m_log.Info("[MonitorModule] " + m_scene.RegionInfo.RegionName + " reports " + monitor.GetName() + " = " + monitor.GetValue()); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | #region Implementation of IRegionModule | ||
26 | |||
27 | public void Initialise(Scene scene, IConfigSource source) | ||
28 | { | ||
29 | m_scene = scene; | ||
30 | |||
31 | |||
32 | m_scene.AddCommand(this, "monitor report", | ||
33 | "monitor report", | ||
34 | "Returns a variety of statistics about the current region and/or simulator", | ||
35 | DebugMonitors); | ||
36 | } | ||
37 | |||
38 | public void PostInitialise() | ||
39 | { | ||
40 | m_monitors.Add(new AgentCountMonitor(m_scene)); | ||
41 | m_monitors.Add(new ChildAgentCountMonitor(m_scene)); | ||
42 | m_monitors.Add(new GCMemoryMonitor()); | ||
43 | m_monitors.Add(new ObjectCountMonitor(m_scene)); | ||
44 | m_monitors.Add(new PhysicsFrameMonitor(m_scene)); | ||
45 | m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); | ||
46 | m_monitors.Add(new PWSMemoryMonitor()); | ||
47 | m_monitors.Add(new ThreadCountMonitor()); | ||
48 | m_monitors.Add(new TotalFrameMonitor(m_scene)); | ||
49 | m_monitors.Add(new EventFrameMonitor(m_scene)); | ||
50 | m_monitors.Add(new LandFrameMonitor(m_scene)); | ||
51 | } | ||
52 | |||
53 | public void Close() | ||
54 | { | ||
55 | |||
56 | } | ||
57 | |||
58 | public string Name | ||
59 | { | ||
60 | get { return "Region Health Monitoring Module"; } | ||
61 | } | ||
62 | |||
63 | public bool IsSharedModule | ||
64 | { | ||
65 | get { return false; } | ||
66 | } | ||
67 | |||
68 | #endregion | ||
69 | } | ||
70 | } | ||