Add new metrics

This commit is contained in:
yflory 2024-07-11 11:06:10 +02:00
parent 36d7d917a7
commit d5d8b0dcab
2 changed files with 5 additions and 3 deletions

View file

@ -393,6 +393,8 @@ const storeMessage = function (Env, channel, msg, isCp, optionalMessageHash, tim
var msgLength = msgBin.length;
index.size += msgLength;
Monitoring.increment('broadcastMessage', (channel.length-1));
// handle the next element in the queue
next();

View file

@ -41,9 +41,9 @@ const remove = (Env, pid) => {
}
};
const increment = (key) => {
calls[key] = calls[key] || 0;
calls[key]++;
const increment = (key, value) => {
if (typeof(value) !== "number") { value = 1; }
calls[key] = (calls[key] || 0) + value;
};
module.exports = {