diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 566772d869..54e6061bb6 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -45,6 +45,7 @@ using OpenSim.Framework.Monitoring; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using Timer=System.Timers.Timer; +using Nini.Config; namespace OpenSim.Framework.Servers { @@ -59,6 +60,7 @@ namespace OpenSim.Framework.Servers /// This will control a periodic log printout of the current 'show stats' (if they are active) for this /// server. /// + private int m_periodDiagnosticTimerMS = 60 * 60 * 1000; private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000); /// @@ -77,8 +79,6 @@ namespace OpenSim.Framework.Servers // Random uuid for private data m_osSecret = UUID.Random().ToString(); - m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); - m_periodicDiagnosticsTimer.Enabled = true; } /// @@ -89,6 +89,16 @@ namespace OpenSim.Framework.Servers StatsManager.SimExtraStats = new SimExtraStatsCollector(); RegisterCommonCommands(); RegisterCommonComponents(Config); + + IConfig startupConfig = Config.Configs["Startup"]; + int logShowStatsSeconds = startupConfig.GetInt("LogShowStatsSeconds", m_periodDiagnosticTimerMS / 1000); + m_periodDiagnosticTimerMS = logShowStatsSeconds * 1000; + m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); + if (m_periodDiagnosticTimerMS != 0) + { + m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS; + m_periodicDiagnosticsTimer.Enabled = true; + } } protected override void ShutdownSpecific() diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index b9fd163169..8b8364cf8c 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -269,6 +269,10 @@ ; PreJump is an additional animation state, but it probably ; won't look right until the physics engine supports it ; (i.e delays takeoff for a moment) + + ; Simulator statistics are output to the console periodically at debug level INFO. + ; Setting this to zero disables this output. + ; LogShowStatsSeconds = 3600 ; Simulator Stats URI ; Enable JSON simulator data by setting a URI name (case sensitive)