From 0d2fd0d914581f755661455b8db2b9e399154632 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 17 Jun 2013 22:39:00 +0100
Subject: 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.
---
OpenSim/Framework/Servers/BaseOpenSimServer.cs | 46 ++++++++------------------
OpenSim/Framework/Servers/ServerBase.cs | 32 ++++++++++++++++++
2 files changed, 45 insertions(+), 33 deletions(-)
(limited to 'OpenSim/Framework/Servers')
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 035b3ad..4ab6908 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -86,26 +86,23 @@ namespace OpenSim.Framework.Servers
///
protected virtual void StartupSpecific()
{
- if (m_console == null)
- return;
-
+ StatsManager.SimExtraStats = new SimExtraStatsCollector();
RegisterCommonCommands();
-
- m_console.Commands.AddCommand("General", false, "quit",
- "quit",
- "Quit the application", HandleQuit);
+ RegisterCommonComponents(Config);
+ }
+
+ protected override void ShutdownSpecific()
+ {
+ m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
+
+ RemovePIDFile();
+
+ base.ShutdownSpecific();
- m_console.Commands.AddCommand("General", false, "shutdown",
- "shutdown",
- "Quit the application", HandleQuit);
+ Environment.Exit(0);
}
///
- /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
- ///
- public virtual void ShutdownSpecific() {}
-
- ///
/// Provides a list of help topics that are available. Overriding classes should append their topics to the
/// information returned when the base method is called.
///
@@ -143,25 +140,8 @@ namespace OpenSim.Framework.Servers
timeTaken.Minutes, timeTaken.Seconds);
}
- ///
- /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
- ///
- public virtual void Shutdown()
+ public string osSecret
{
- ShutdownSpecific();
-
- m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
- RemovePIDFile();
-
- Environment.Exit(0);
- }
-
- private void HandleQuit(string module, string[] args)
- {
- Shutdown();
- }
-
- public string osSecret {
// Secret uuid for the simulator
get { return m_osSecret; }
}
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
protected string m_pidFile = String.Empty;
+ protected ServerStatsCollector m_serverStatsCollector;
+
///
/// Server version information. Usually VersionInfo + information about git commit, operating system, etc.
///
@@ -259,6 +261,25 @@ namespace OpenSim.Framework.Servers
"force gc",
"Manually invoke runtime garbage collection. For debugging purposes",
HandleForceGc);
+
+ m_console.Commands.AddCommand(
+ "General", false, "quit",
+ "quit",
+ "Quit the application", (mod, args) => Shutdown());
+
+ m_console.Commands.AddCommand(
+ "General", false, "shutdown",
+ "shutdown",
+ "Quit the application", (mod, args) => Shutdown());
+
+ StatsManager.RegisterConsoleCommands(m_console);
+ }
+
+ public void RegisterCommonComponents(IConfigSource configSource)
+ {
+ m_serverStatsCollector = new ServerStatsCollector();
+ m_serverStatsCollector.Initialise(configSource);
+ m_serverStatsCollector.Start();
}
private void HandleForceGc(string module, string[] args)
@@ -698,5 +719,16 @@ namespace OpenSim.Framework.Servers
if (m_console != null)
m_console.OutputFormat(format, components);
}
+
+ public virtual void Shutdown()
+ {
+ m_serverStatsCollector.Close();
+ ShutdownSpecific();
+ }
+
+ ///
+ /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
+ ///
+ protected virtual void ShutdownSpecific() {}
}
}
\ No newline at end of file
--
cgit v1.1