aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs43
1 files changed, 15 insertions, 28 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index cf19002..605909d 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -96,11 +96,6 @@ namespace OpenSim.Framework.Servers
96 get { return m_httpServer; } 96 get { return m_httpServer; }
97 } 97 }
98 98
99 /// <summary>
100 /// Holds the non-viewer statistics collection object for this service/server
101 /// </summary>
102 protected IStatsCollector m_stats;
103
104 public BaseOpenSimServer() 99 public BaseOpenSimServer()
105 { 100 {
106 m_startuptime = DateTime.Now; 101 m_startuptime = DateTime.Now;
@@ -177,10 +172,6 @@ namespace OpenSim.Framework.Servers
177 "show info", 172 "show info",
178 "Show general information about the server", HandleShow); 173 "Show general information about the server", HandleShow);
179 174
180 m_console.Commands.AddCommand("General", false, "show stats",
181 "show stats",
182 "Show statistics", HandleShow);
183
184 m_console.Commands.AddCommand("General", false, "show threads", 175 m_console.Commands.AddCommand("General", false, "show threads",
185 "show threads", 176 "show threads",
186 "Show thread status", HandleShow); 177 "Show thread status", HandleShow);
@@ -201,8 +192,19 @@ namespace OpenSim.Framework.Servers
201 "threads show", 192 "threads show",
202 "Show thread status. Synonym for \"show threads\"", 193 "Show thread status. Synonym for \"show threads\"",
203 (string module, string[] args) => Notice(GetThreadsReport())); 194 (string module, string[] args) => Notice(GetThreadsReport()));
195
196 m_console.Commands.AddCommand("General", false, "force gc",
197 "force gc",
198 "Manually invoke runtime garbage collection. For debugging purposes",
199 HandleForceGc);
204 } 200 }
205 } 201 }
202
203 private void HandleForceGc(string module, string[] args)
204 {
205 MainConsole.Instance.Output("Manually invoking runtime garbage collection");
206 GC.Collect();
207 }
206 208
207 /// <summary> 209 /// <summary>
208 /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing 210 /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
@@ -226,12 +228,7 @@ namespace OpenSim.Framework.Servers
226 { 228 {
227 StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n"); 229 StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n");
228 sb.Append(GetUptimeReport()); 230 sb.Append(GetUptimeReport());
229 231 sb.Append(StatsManager.SimExtraStats.Report());
230 if (m_stats != null)
231 {
232 sb.Append(m_stats.Report());
233 }
234
235 sb.Append(Environment.NewLine); 232 sb.Append(Environment.NewLine);
236 sb.Append(GetThreadsReport()); 233 sb.Append(GetThreadsReport());
237 234
@@ -382,10 +379,6 @@ namespace OpenSim.Framework.Servers
382 { 379 {
383 Notice("set log level [level] - change the console logging level only. For example, off or debug."); 380 Notice("set log level [level] - change the console logging level only. For example, off or debug.");
384 Notice("show info - show server information (e.g. startup path)."); 381 Notice("show info - show server information (e.g. startup path).");
385
386 if (m_stats != null)
387 Notice("show stats - show statistical information for this server");
388
389 Notice("show threads - list tracked threads"); 382 Notice("show threads - list tracked threads");
390 Notice("show uptime - show server startup time and uptime."); 383 Notice("show uptime - show server startup time and uptime.");
391 Notice("show version - show server version."); 384 Notice("show version - show server version.");
@@ -409,11 +402,6 @@ namespace OpenSim.Framework.Servers
409 ShowInfo(); 402 ShowInfo();
410 break; 403 break;
411 404
412 case "stats":
413 if (m_stats != null)
414 Notice(m_stats.Report());
415 break;
416
417 case "threads": 405 case "threads":
418 Notice(GetThreadsReport()); 406 Notice(GetThreadsReport());
419 break; 407 break;
@@ -604,8 +592,7 @@ namespace OpenSim.Framework.Servers
604 592
605 public string osSecret { 593 public string osSecret {
606 // Secret uuid for the simulator 594 // Secret uuid for the simulator
607 get { return m_osSecret; } 595 get { return m_osSecret; }
608
609 } 596 }
610 597
611 public string StatReport(IOSHttpRequest httpRequest) 598 public string StatReport(IOSHttpRequest httpRequest)
@@ -613,11 +600,11 @@ namespace OpenSim.Framework.Servers
613 // If we catch a request for "callback", wrap the response in the value for jsonp 600 // If we catch a request for "callback", wrap the response in the value for jsonp
614 if (httpRequest.Query.ContainsKey("callback")) 601 if (httpRequest.Query.ContainsKey("callback"))
615 { 602 {
616 return httpRequest.Query["callback"].ToString() + "(" + m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");"; 603 return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");";
617 } 604 }
618 else 605 else
619 { 606 {
620 return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version); 607 return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version);
621 } 608 }
622 } 609 }
623 610