forked from Galactic/galactic-bot
fix average calc
This commit is contained in:
parent
65a9549b9c
commit
c1c131ecd7
@ -114,7 +114,7 @@ class StatsCommand extends SlashCommand {
|
|||||||
successExecTime: Math.round(commands.reduce((acc, cmd) => acc + cmd._invokes.successTime, 0) / commands.size),
|
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),
|
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;
|
return values;
|
||||||
};
|
};
|
||||||
const commandValues = {};
|
const commandValues = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user