From f1f935ed9543141cc5861a7204b6df85a7358ab4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 13 Aug 2014 19:53:42 +0100 Subject: Add 'server' stats information to pCampbot, as used elsewhere in OpenSimulator This adds the "show stats", "stats record", etc. commands and information on available Threadpool threads, etc. It also adds the Watchdog which logs warnings if time between executions is unexpectedly large. --- OpenSim/Tools/pCampBot/BotManager.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'OpenSim/Tools/pCampBot/BotManager.cs') diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 69dd950..b199931 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -38,6 +38,7 @@ using log4net.Repository; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Console; +using OpenSim.Framework.Monitoring; using pCampBot.Interfaces; namespace pCampBot @@ -143,6 +144,11 @@ namespace pCampBot private HashSet m_defaultBehaviourSwitches = new HashSet(); /// + /// Collects general information on this server (which reveals this to be a misnamed class). + /// + private ServerStatsCollector m_serverStatsCollector; + + /// /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data /// public BotManager() @@ -151,6 +157,12 @@ namespace pCampBot // to multiple regions. Settings.MAX_HTTP_CONNECTIONS = int.MaxValue; +// System.Threading.ThreadPool.SetMaxThreads(600, 240); +// +// int workerThreads, iocpThreads; +// System.Threading.ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads); +// Console.WriteLine("ThreadPool.GetMaxThreads {0} {1}", workerThreads, iocpThreads); + InitBotSendAgentUpdates = true; InitBotRequestObjectTextures = true; @@ -234,6 +246,14 @@ namespace pCampBot "Shows the detailed status and settings of a particular bot.", HandleShowBotStatus); m_bots = new List(); + + Watchdog.Enabled = true; + StatsManager.RegisterConsoleCommands(m_console); + + m_serverStatsCollector = new ServerStatsCollector(); + m_serverStatsCollector.Initialise(null); + m_serverStatsCollector.Enabled = true; + m_serverStatsCollector.Start(); } /// @@ -697,6 +717,8 @@ namespace pCampBot MainConsole.Instance.Output("Shutting down"); + m_serverStatsCollector.Close(); + Environment.Exit(0); } -- cgit v1.1