Added command counts to Prometheus metrics
This commit is contained in:
parent
d0a4addcb5
commit
e5d9388952
4 changed files with 21 additions and 11 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue