Log gateway latency to console

This commit is contained in:
Ske 2019-08-12 04:05:22 +02:00
parent aa04d2055e
commit c68ce1bdd3

View File

@ -105,8 +105,8 @@ namespace PluralKit.Bot
.AddTransient<ProxyService>()
.AddTransient<LogChannelService>()
.AddTransient<DataFileService>()
.AddSingleton<ProxyCacheService>()
.AddTransient<ProxyCacheService>()
.AddSingleton<WebhookCacheService>()
.AddTransient<SystemStore>()
@ -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<IUserMessage, ulong> message, ISocketMessageChannel channel,