-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the value of stat increment doesn't change #22
Comments
That looks right. Your console log is showing the amount that the counter is being incremented by. |
but i need to show the value of stat variable (retriveProducts ) not the amount that the counter is being incremented by. |
Then you want a gauge, not a counter. |
let me describe what i want to do , i'd like to display how many times certain function has been invoked. FYI:i used gauge and the same thing |
It sounds like you want a counter, and a backend that keeps track of the counts. The only way I know how to do this is to connect it with graphite or another backend that aggregates your counts. If you're working with multiple servers, graphite is the backend to use. |
i have created the following listener and registered it when the server is starting to listen to the event of stat.increment and log the value into the console but unfortunately the value is always 1
listener.js
var statMonitor = require('monitor').Stat;
exports.InitListeners = function() {
statMonitor.on('*', function myListenerFunction(module, name, value, type) {
console.log('module: ' + module + ' stat: ' + name + ' value: ' + value + ' type: '+type);
});
}
and here is calling of stat increment
var stat = require('monitor').getStatLogger('products');
function getProducts(opts, req, res, callback){
stat.increment('retriveProducts');
}
and here the log
module: products stat: retriveProducts value: 1 type: c
The text was updated successfully, but these errors were encountered: