mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
Add "show threadpool calls" command to show count of all labelled smartthreadpool calls
This commit is contained in:
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -291,6 +292,12 @@ namespace OpenSim.Framework.Servers
|
||||
+ " 3 = full stack trace, including common threads\n",
|
||||
HandleDebugThreadpoolLevel);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Debug", false, "show threadpool calls",
|
||||
"show threadpool calls",
|
||||
"Show the number of labelled threadpool calls.",
|
||||
HandleShowThreadpoolCalls);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Debug", false, "force gc",
|
||||
"force gc",
|
||||
@@ -354,6 +361,20 @@ namespace OpenSim.Framework.Servers
|
||||
Notice("serialosdreq is now {0}", setSerializeOsdRequests);
|
||||
}
|
||||
|
||||
private void HandleShowThreadpoolCalls(string module, string[] args)
|
||||
{
|
||||
List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsMade().ToList();
|
||||
calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value));
|
||||
|
||||
ConsoleDisplayList cdl = new ConsoleDisplayList();
|
||||
foreach (KeyValuePair<string, int> kvp in calls)
|
||||
{
|
||||
cdl.AddRow(kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
MainConsole.Instance.Output(cdl.ToString());
|
||||
}
|
||||
|
||||
private void HandleDebugThreadpoolStatus(string module, string[] args)
|
||||
{
|
||||
int workerThreads, iocpThreads;
|
||||
|
||||
Reference in New Issue
Block a user