Skip to content

Instantly share code, notes, and snippets.

@Unitech
Created October 7, 2014 10:11
Show Gist options
  • Save Unitech/185c4e85f6ba1a8c22e8 to your computer and use it in GitHub Desktop.
Save Unitech/185c4e85f6ba1a8c22e8 to your computer and use it in GitHub Desktop.
var profiler = require('profiler');
profiler.monitor('redis', redisClient);
// What is redisCLient ? Is it the return of require('redis') ?
profiler.monitor('mongodb', mongodb_client);
profiler.monitor('rethinkdb', rethinkdb_client);
profiler.on('query', function(parameters){
console.log(parameters);
/**
*
* Get something like
*
* {
* db : 'redis',
* timespan : 35, // time took to do the query
* at : 234234423 // UTC time when the query has been finished
* arguments : {
* {} {} // Mixed object that can describe in details the query (parameters...)
* }
* }
*
*******/
});
@vodolaz095
Copy link

// What is redisCLient ? Is it the return of require('redis') ?
no, instance of redis client


   require('redis').createClient(port, host, callback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment