Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

statsy

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

statsy

statsd client

Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
22
266.67%
Maintainers
1
Weekly downloads
 
Created
Source

statsy

A simple statsd client.

Installation

$ npm install statsy

Example


var Client = require('statsy');
var http = require('http');
var stats = new Client;

setInterval(function(){
  stats.incr('requests');
  var end = stats.timer('request');
  http.get('http://yahoo.com', function(err, res){
    // do stuff
    end();
  });
}, 1000);

API

Client([opts])

Initialize a client with the given options:

  • host [localhost]
  • port [8125]
  • prefix optional prefix ('.' is appended)

Events from the socket are forwarded, however by default errors are simply ignored.

.gauge(name, val)

Send gauge value.

.meter(name, val)

Send meter value.

.count(name, val)

Send count value.

.incr(name, [val])

Increment by val or 1.

.decr(name, [val])

Decrement by val or 1.

.timer(name, val)

Send timer value.

.timer(name)

Return timer delta function.

License

MIT

Keywords

statsd

FAQs

Package last updated on 15 Apr 2014

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