mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
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.
This commit is contained in:
@@ -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
|
||||
@@ -142,6 +143,11 @@ namespace pCampBot
|
||||
/// </summary>
|
||||
private HashSet<string> m_defaultBehaviourSwitches = new HashSet<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Collects general information on this server (which reveals this to be a misnamed class).
|
||||
/// </summary>
|
||||
private ServerStatsCollector m_serverStatsCollector;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor Creates MainConsole.Instance to take commands and provide the place to write data
|
||||
/// </summary>
|
||||
@@ -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<Bot>();
|
||||
|
||||
Watchdog.Enabled = true;
|
||||
StatsManager.RegisterConsoleCommands(m_console);
|
||||
|
||||
m_serverStatsCollector = new ServerStatsCollector();
|
||||
m_serverStatsCollector.Initialise(null);
|
||||
m_serverStatsCollector.Enabled = true;
|
||||
m_serverStatsCollector.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -697,6 +717,8 @@ namespace pCampBot
|
||||
|
||||
MainConsole.Instance.Output("Shutting down");
|
||||
|
||||
m_serverStatsCollector.Close();
|
||||
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user