diff options
author | Adam Frisby | 2009-11-11 00:22:06 +1100 |
---|---|---|
committer | Adam Frisby | 2009-11-11 00:22:06 +1100 |
commit | 90b15aa440a6a7d8ddae6df6006aff8010d21405 (patch) | |
tree | 5684db8ea6fa602f5111a2433310725f8b50127d | |
parent | Fixed XMLRPC return params (diff) | |
download | opensim-SC_OLD-90b15aa440a6a7d8ddae6df6006aff8010d21405.zip opensim-SC_OLD-90b15aa440a6a7d8ddae6df6006aff8010d21405.tar.gz opensim-SC_OLD-90b15aa440a6a7d8ddae6df6006aff8010d21405.tar.bz2 opensim-SC_OLD-90b15aa440a6a7d8ddae6df6006aff8010d21405.tar.xz |
* Added HTTP polling for Statistics Monitor Module (access via http://sim.com:httpport/monitorstats/regionUUID/)
* Returns simple formatted XML document containing statistical data on the current sim.
* Example:
<data>
<AgentCountMonitor>5.0000</AgentCountMonitor>
...
</data>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 769af8d..b6a2025 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs | |||
@@ -1,7 +1,10 @@ | |||
1 | using System.Collections.Generic; | 1 | using System.Collections; |
2 | using System.Collections.Generic; | ||
2 | using System.Reflection; | 3 | using System.Reflection; |
3 | using log4net; | 4 | using log4net; |
4 | using Nini.Config; | 5 | using Nini.Config; |
6 | using OpenMetaverse; | ||
7 | using OpenSim.Framework; | ||
5 | using OpenSim.Region.CoreModules.Framework.Monitoring.Alerts; | 8 | using OpenSim.Region.CoreModules.Framework.Monitoring.Alerts; |
6 | using OpenSim.Region.CoreModules.Framework.Monitoring.Monitors; | 9 | using OpenSim.Region.CoreModules.Framework.Monitoring.Monitors; |
7 | using OpenSim.Region.Framework.Interfaces; | 10 | using OpenSim.Region.Framework.Interfaces; |
@@ -43,6 +46,26 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring | |||
43 | "monitor report", | 46 | "monitor report", |
44 | "Returns a variety of statistics about the current region and/or simulator", | 47 | "Returns a variety of statistics about the current region and/or simulator", |
45 | DebugMonitors); | 48 | DebugMonitors); |
49 | |||
50 | MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); | ||
51 | } | ||
52 | |||
53 | public Hashtable StatsPage(Hashtable request) | ||
54 | { | ||
55 | string xml = "<data>"; | ||
56 | foreach (IMonitor monitor in m_monitors) | ||
57 | { | ||
58 | xml += "<" + monitor.ToString() + ">" + monitor.GetValue() + "</" + monitor.ToString() + ">"; | ||
59 | } | ||
60 | xml += "</data>"; | ||
61 | |||
62 | Hashtable ereply = new Hashtable(); | ||
63 | |||
64 | ereply["int_response_code"] = 200; // 200 OK | ||
65 | ereply["str_response_string"] = xml; | ||
66 | ereply["content_type"] = "text/xml"; | ||
67 | |||
68 | return ereply; | ||
46 | } | 69 | } |
47 | 70 | ||
48 | public void PostInitialise() | 71 | public void PostInitialise() |