From c68ce1bdd3adafb738e71426f5d1bfd12e7714f5 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 12 Aug 2019 04:05:22 +0200 Subject: [PATCH] Log gateway latency to console --- PluralKit.Bot/Bot.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index f3d06118..f920328c 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -105,8 +105,8 @@ namespace PluralKit.Bot .AddTransient() .AddTransient() .AddTransient() - - .AddSingleton() + + .AddTransient() .AddSingleton() .AddTransient() @@ -368,6 +368,9 @@ namespace PluralKit.Bot private void RegisterMessageMetrics(SocketMessage msg) { _metrics.Measure.Meter.Mark(BotMetrics.MessagesReceived); + + var gatewayLatency = DateTimeOffset.Now - msg.CreatedAt; + _logger.Debug("Message received with latency {Latency}", gatewayLatency); } public Task HandleReactionAdded(Cacheable message, ISocketMessageChannel channel,