Redis histogram for node.js
$ npm install redis-histogram
var Histogram = require('..');
var redis = require('redis');
var hist = new Histogram({
client: redis.createClient(),
bins: 10
});
var n = 1000;
while (n--) {
hist.add(Math.random() * 50 | 0);
}
hist.load(function(err, res){
console.log(res)
});
client
redis clientkey
redis key ["histogram"]bins
number of bins [1000]
Bin value
with optional callback.
Load histogram bins.
MIT