Skip to content

Commit

Permalink
Add ThreadPool info to ServerStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
Mag-nus committed Feb 10, 2024
1 parent 39592f2 commit 706e296
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/ACE.Server/Command/Handlers/AdminStatCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;

using ACE.Common;
using ACE.Database;
Expand Down Expand Up @@ -52,6 +53,12 @@ public static void HandleServerStatus(Session session, params string[] parameter

sb.Append($"Host Info: {Environment.OSVersion}, vCPU: {Environment.ProcessorCount}{'\n'}");

ThreadPool.GetMinThreads(out var minWorkerThreads, out var minCompletionPortThreads);
ThreadPool.GetMaxThreads(out var maxWorkerThreads, out var maxCompletionPortThreads);
ThreadPool.GetAvailableThreads(out var availWorkerThreads, out var availCompletionPortThreads);

sb.Append($"ThreadPool Min: {minWorkerThreads} {minCompletionPortThreads}, Max: {maxWorkerThreads} {maxCompletionPortThreads}, Avail: {availWorkerThreads} {availCompletionPortThreads}, Current: {ThreadPool.ThreadCount}{'\n'}");

var runTime = DateTime.Now - proc.StartTime;
sb.Append($"Server Runtime: {(int)runTime.TotalHours}h {runTime.Minutes}m {runTime.Seconds}s{'\n'}");

Expand Down

0 comments on commit 706e296

Please sign in to comment.