diff options
author | Justin Clark-Casey (justincc) | 2013-06-17 22:39:00 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-06-17 22:39:00 +0100 |
commit | 0d2fd0d914581f755661455b8db2b9e399154632 (patch) | |
tree | b3c8f5634d946d8e623f761eb7001f254d2af9be /OpenSim/Framework/Servers/ServerBase.cs | |
parent | correct method doc for llRot2Axis() (diff) | |
download | opensim-SC-0d2fd0d914581f755661455b8db2b9e399154632.zip opensim-SC-0d2fd0d914581f755661455b8db2b9e399154632.tar.gz opensim-SC-0d2fd0d914581f755661455b8db2b9e399154632.tar.bz2 opensim-SC-0d2fd0d914581f755661455b8db2b9e399154632.tar.xz |
Make general server stats available on the robust console as well as the simulator console
This means the "show stats" command is now active on the robust console.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/ServerBase.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 2c4a687..5358444 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -62,6 +62,8 @@ namespace OpenSim.Framework.Servers | |||
62 | 62 | ||
63 | protected string m_pidFile = String.Empty; | 63 | protected string m_pidFile = String.Empty; |
64 | 64 | ||
65 | protected ServerStatsCollector m_serverStatsCollector; | ||
66 | |||
65 | /// <summary> | 67 | /// <summary> |
66 | /// Server version information. Usually VersionInfo + information about git commit, operating system, etc. | 68 | /// Server version information. Usually VersionInfo + information about git commit, operating system, etc. |
67 | /// </summary> | 69 | /// </summary> |
@@ -259,6 +261,25 @@ namespace OpenSim.Framework.Servers | |||
259 | "force gc", | 261 | "force gc", |
260 | "Manually invoke runtime garbage collection. For debugging purposes", | 262 | "Manually invoke runtime garbage collection. For debugging purposes", |
261 | HandleForceGc); | 263 | HandleForceGc); |
264 | |||
265 | m_console.Commands.AddCommand( | ||
266 | "General", false, "quit", | ||
267 | "quit", | ||
268 | "Quit the application", (mod, args) => Shutdown()); | ||
269 | |||
270 | m_console.Commands.AddCommand( | ||
271 | "General", false, "shutdown", | ||
272 | "shutdown", | ||
273 | "Quit the application", (mod, args) => Shutdown()); | ||
274 | |||
275 | StatsManager.RegisterConsoleCommands(m_console); | ||
276 | } | ||
277 | |||
278 | public void RegisterCommonComponents(IConfigSource configSource) | ||
279 | { | ||
280 | m_serverStatsCollector = new ServerStatsCollector(); | ||
281 | m_serverStatsCollector.Initialise(configSource); | ||
282 | m_serverStatsCollector.Start(); | ||
262 | } | 283 | } |
263 | 284 | ||
264 | private void HandleForceGc(string module, string[] args) | 285 | private void HandleForceGc(string module, string[] args) |
@@ -698,5 +719,16 @@ namespace OpenSim.Framework.Servers | |||
698 | if (m_console != null) | 719 | if (m_console != null) |
699 | m_console.OutputFormat(format, components); | 720 | m_console.OutputFormat(format, components); |
700 | } | 721 | } |
722 | |||
723 | public virtual void Shutdown() | ||
724 | { | ||
725 | m_serverStatsCollector.Close(); | ||
726 | ShutdownSpecific(); | ||
727 | } | ||
728 | |||
729 | /// <summary> | ||
730 | /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing | ||
731 | /// </summary> | ||
732 | protected virtual void ShutdownSpecific() {} | ||
701 | } | 733 | } |
702 | } \ No newline at end of file | 734 | } \ No newline at end of file |