From 2128b1a089a997194c3cb6c2b331ca1e0699d62e Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 12 Sep 2021 02:02:48 +0300 Subject: [PATCH] Tweak rate limit debug command formatting --- .../BotControl/commands/RateLimitPerformanceCmd.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts b/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts index fdf81993..ac355689 100644 --- a/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts +++ b/backend/src/plugins/BotControl/commands/RateLimitPerformanceCmd.ts @@ -21,9 +21,13 @@ export const RateLimitPerformanceCmd = botControlCmd({ logItems.reverse(); const formatted = logItems.map((item) => { const formattedTime = moment.utc(item.timestamp).format("YYYY-MM-DD HH:mm:ss.SSS"); - return `${item.data.global ? "GLOBAL " : ""}${item.data.method} ${item.data.route} stalled for ${ - item.data.timeout - }ms`; + const items: string[] = [`[${formattedTime}]`]; + if (item.data.global) items.push("GLOBAL"); + items.push(item.data.method.toUpperCase()); + items.push(item.data.route); + items.push(`stalled for ${item.data.timeout}ms`); + items.push(`(max requests ${item.data.limit})`); + return items.join(" "); }); const fullText = `Last ${logItems.length} rate limits hit:\n\n${formatted.join("\n")}`;