fix average calc

This commit is contained in:
Erik 2022-08-03 21:04:03 +03:00
parent 65a9549b9c
commit c1c131ecd7
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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 = {};