diff options
author | Justin Clark-Casey (justincc) | 2014-11-04 17:21:22 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:23:10 +0000 |
commit | f54c70741b4008c242aa8f088be7551bfe41ac1f (patch) | |
tree | ebd89f57749eed1a247ef6f013395e1a65539f60 /OpenSim/Framework/Servers/ServerBase.cs | |
parent | Add naive implementation of controlled incoming HG attachments to manage load. (diff) | |
download | opensim-SC-f54c70741b4008c242aa8f088be7551bfe41ac1f.zip opensim-SC-f54c70741b4008c242aa8f088be7551bfe41ac1f.tar.gz opensim-SC-f54c70741b4008c242aa8f088be7551bfe41ac1f.tar.bz2 opensim-SC-f54c70741b4008c242aa8f088be7551bfe41ac1f.tar.xz |
Add "show threadpool calls active" console debug command.
This shows named threadpool calls (excluding timer and network calls) that are currently queued or running.
Also shows total of labelled and any anonymous calls.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/ServerBase.cs | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index eb9fb8b..c22c119 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -293,10 +293,16 @@ namespace OpenSim.Framework.Servers | |||
293 | HandleDebugThreadpoolLevel); | 293 | HandleDebugThreadpoolLevel); |
294 | 294 | ||
295 | m_console.Commands.AddCommand( | 295 | m_console.Commands.AddCommand( |
296 | "Debug", false, "show threadpool calls", | 296 | "Debug", false, "show threadpool calls active", |
297 | "show threadpool calls", | 297 | "show threadpool calls active", |
298 | "Show the number of labelled threadpool calls.", | 298 | "Show details about threadpool calls that are still active (currently waiting or in progress)", |
299 | HandleShowThreadpoolCalls); | 299 | HandleShowThreadpoolCallsActive); |
300 | |||
301 | m_console.Commands.AddCommand( | ||
302 | "Debug", false, "show threadpool calls complete", | ||
303 | "show threadpool calls complete", | ||
304 | "Show details about threadpool calls that have been completed.", | ||
305 | HandleShowThreadpoolCallsComplete); | ||
300 | 306 | ||
301 | m_console.Commands.AddCommand( | 307 | m_console.Commands.AddCommand( |
302 | "Debug", false, "force gc", | 308 | "Debug", false, "force gc", |
@@ -361,7 +367,36 @@ namespace OpenSim.Framework.Servers | |||
361 | Notice("serialosdreq is now {0}", setSerializeOsdRequests); | 367 | Notice("serialosdreq is now {0}", setSerializeOsdRequests); |
362 | } | 368 | } |
363 | 369 | ||
364 | private void HandleShowThreadpoolCalls(string module, string[] args) | 370 | private void HandleShowThreadpoolCallsActive(string module, string[] args) |
371 | { | ||
372 | List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsInProgress().ToList(); | ||
373 | calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value)); | ||
374 | int namedCalls = 0; | ||
375 | |||
376 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | ||
377 | foreach (KeyValuePair<string, int> kvp in calls) | ||
378 | { | ||
379 | if (kvp.Value > 0) | ||
380 | { | ||
381 | cdl.AddRow(kvp.Key, kvp.Value); | ||
382 | namedCalls += kvp.Value; | ||
383 | } | ||
384 | } | ||
385 | |||
386 | cdl.AddRow("TOTAL NAMED", namedCalls); | ||
387 | |||
388 | long allQueuedCalls = Util.TotalQueuedFireAndForgetCalls; | ||
389 | long allRunningCalls = Util.TotalRunningFireAndForgetCalls; | ||
390 | |||
391 | cdl.AddRow("TOTAL QUEUED", allQueuedCalls); | ||
392 | cdl.AddRow("TOTAL RUNNING", allRunningCalls); | ||
393 | cdl.AddRow("TOTAL ANONYMOUS", allQueuedCalls + allRunningCalls - namedCalls); | ||
394 | cdl.AddRow("TOTAL ALL", allQueuedCalls + allRunningCalls); | ||
395 | |||
396 | MainConsole.Instance.Output(cdl.ToString()); | ||
397 | } | ||
398 | |||
399 | private void HandleShowThreadpoolCallsComplete(string module, string[] args) | ||
365 | { | 400 | { |
366 | List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsMade().ToList(); | 401 | List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsMade().ToList(); |
367 | calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value)); | 402 | calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value)); |