Socket
Book a DemoInstallSign in
Socket

redis-histogram

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-histogram

histogram binning in redis

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

redis-histogram

Redis histogram for node.js

Installation

$ npm install redis-histogram

Example

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)
});

API

Histogram(options)

  • client redis client
  • key redis key ["histogram"]
  • bins number of bins [1000]

Histogram#add(value, [fn])

Bin value with optional callback.

Histogram#load(fn)

Load histogram bins.

License

MIT

Keywords

histo

FAQs

Package last updated on 31 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts