Added command counts to Prometheus metrics

This commit is contained in:
TheEssem 2021-05-03 08:49:55 -05:00
parent d0a4addcb5
commit e5d9388952
4 changed files with 21 additions and 11 deletions

View file

@ -51,11 +51,12 @@ exports.enableChannel = async (channel) => {
exports.getCounts = async () => {
const counts = await connection.query("SELECT * FROM counts");
const countArray = [];
//const countArray = [];
const countObject = {};
for (const { command, count } of counts.rows) {
countArray.push([command, count]);
countObject[command] = count;
}
return countArray;
return countObject;
};
exports.addCount = async (command) => {