From c1c131ecd712a2c26612fd562a5c21b8154f9eaf Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 3 Aug 2022 21:04:03 +0300 Subject: [PATCH] fix average calc --- src/structure/components/commands/developer/Stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/structure/components/commands/developer/Stats.js b/src/structure/components/commands/developer/Stats.js index a12dd9d..854c0a6 100644 --- a/src/structure/components/commands/developer/Stats.js +++ b/src/structure/components/commands/developer/Stats.js @@ -114,7 +114,7 @@ class StatsCommand extends SlashCommand { successExecTime: Math.round(commands.reduce((acc, cmd) => acc + cmd._invokes.successTime, 0) / commands.size), failExecTime: Math.round(commands.reduce((acc, cmd) => acc + cmd._invokes.failTime, 0) / commands.size), }; - values.avgTime = Math.round((values.successExecTime + values.failExecTime) / 2); + values.avgTime = Math.round((values.successExecTime * values.success + values.failExecTime * values.fail) / values.invokes); return values; }; const commandValues = {};