From b6597c79d65f910b001261719a87e593a48cd510 Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 22 Dec 2019 23:27:11 +0100 Subject: [PATCH] Add temporary ThreadPool trace logging --- PluralKit.Bot/Bot.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index c4b7ebe5..803d81e7 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -304,6 +304,9 @@ namespace PluralKit.Bot if (_client.GetShardFor((arg.Channel as IGuildChannel)?.Guild).ConnectionState != ConnectionState.Connected) return; // Discard messages while the bot "catches up" to avoid unnecessary CPU pressure causing timeouts + + _logger.Debug("ThreadPool pending count: {PendingCount}, completed: {CompletedCount}, {ThreadCount} threads", ThreadPool.PendingWorkItemCount, ThreadPool.CompletedWorkItemCount, ThreadPool.ThreadCount); + RegisterMessageMetrics(arg); // Ignore system messages (member joined, message pinned, etc)