aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-08-13 19:53:42 +0100
committerJustin Clark-Casey (justincc)2014-08-13 19:53:42 +0100
commitf1f935ed9543141cc5861a7204b6df85a7358ab4 (patch)
treea16c08b5df4397b96a306c45583d804745df8698 /OpenSim/Tools/pCampBot
parentFor pCampbot, set max number of permitted connections to an endpoint to int.M... (diff)
downloadopensim-SC-f1f935ed9543141cc5861a7204b6df85a7358ab4.zip
opensim-SC-f1f935ed9543141cc5861a7204b6df85a7358ab4.tar.gz
opensim-SC-f1f935ed9543141cc5861a7204b6df85a7358ab4.tar.bz2
opensim-SC-f1f935ed9543141cc5861a7204b6df85a7358ab4.tar.xz
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.
Diffstat (limited to 'OpenSim/Tools/pCampBot')
-rw-r--r--OpenSim/Tools/pCampBot/BotManager.cs22
1 files changed, 22 insertions, 0 deletions
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;
38using Nini.Config; 38using Nini.Config;
39using OpenSim.Framework; 39using OpenSim.Framework;
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Framework.Monitoring;
41using pCampBot.Interfaces; 42using pCampBot.Interfaces;
42 43
43namespace pCampBot 44namespace pCampBot
@@ -143,6 +144,11 @@ namespace pCampBot
143 private HashSet<string> m_defaultBehaviourSwitches = new HashSet<string>(); 144 private HashSet<string> m_defaultBehaviourSwitches = new HashSet<string>();
144 145
145 /// <summary> 146 /// <summary>
147 /// Collects general information on this server (which reveals this to be a misnamed class).
148 /// </summary>
149 private ServerStatsCollector m_serverStatsCollector;
150
151 /// <summary>
146 /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data 152 /// Constructor Creates MainConsole.Instance to take commands and provide the place to write data
147 /// </summary> 153 /// </summary>
148 public BotManager() 154 public BotManager()
@@ -151,6 +157,12 @@ namespace pCampBot
151 // to multiple regions. 157 // to multiple regions.
152 Settings.MAX_HTTP_CONNECTIONS = int.MaxValue; 158 Settings.MAX_HTTP_CONNECTIONS = int.MaxValue;
153 159
160// System.Threading.ThreadPool.SetMaxThreads(600, 240);
161//
162// int workerThreads, iocpThreads;
163// System.Threading.ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads);
164// Console.WriteLine("ThreadPool.GetMaxThreads {0} {1}", workerThreads, iocpThreads);
165
154 InitBotSendAgentUpdates = true; 166 InitBotSendAgentUpdates = true;
155 InitBotRequestObjectTextures = true; 167 InitBotRequestObjectTextures = true;
156 168
@@ -234,6 +246,14 @@ namespace pCampBot
234 "Shows the detailed status and settings of a particular bot.", HandleShowBotStatus); 246 "Shows the detailed status and settings of a particular bot.", HandleShowBotStatus);
235 247
236 m_bots = new List<Bot>(); 248 m_bots = new List<Bot>();
249
250 Watchdog.Enabled = true;
251 StatsManager.RegisterConsoleCommands(m_console);
252
253 m_serverStatsCollector = new ServerStatsCollector();
254 m_serverStatsCollector.Initialise(null);
255 m_serverStatsCollector.Enabled = true;
256 m_serverStatsCollector.Start();
237 } 257 }
238 258
239 /// <summary> 259 /// <summary>
@@ -697,6 +717,8 @@ namespace pCampBot
697 717
698 MainConsole.Instance.Output("Shutting down"); 718 MainConsole.Instance.Output("Shutting down");
699 719
720 m_serverStatsCollector.Close();
721
700 Environment.Exit(0); 722 Environment.Exit(0);
701 } 723 }
702 724