Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dog-statsy

Package Overview
Dependencies
Maintainers
151
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dog-statsy

dogstatsd client

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
151
Created
Source

dog-statsy Circle CI

A dogstatsd client.

Installation

$ npm install dog-statsy

Example

const Client = require('dog-statsy')
const http = require('http')
const stats = new Client({})

setInterval(function(){
  const start = new Date
  http.get('http://yahoo.com', function(err, res){
    const ms = new Date - start
    stats.histogram('request.duration', ms, ['request:yahoo'])
  })
}, 1000)

API

Client([opts])

Initialize a client with the given options:

  • host [localhost]
  • port [8125]
  • prefix optional prefix ('.' is appended)
  • tags array of tags to include in every call
  • bufferSize optional buffer size, if not defined, it will send the data immediately
  • flushInterval optional, only valid when bufferSize is defined. It will flush the buffer after the interval in miliseconds (if not empty)

.gauge(name, val, [tags])

Send gauge value.

.meter(name, val, [tags])

Send meter value.

.set(name, val, [tags])

Send set value.

.count(name, val, [tags])

Send count value.

.incr(name, [val], [tags])

Increment by val or 1.

.decr(name, [val], [tags])

Decrement by val or 1.

.histogram(name, val, [tags])

Send histogram value.

.histogram(name)

Return histogram delta function.

.timer(name, val, [tags])

Send timer value.

.timer(name)

Return timer delta function.

.trace(name, [tags])

Return a trace object.

Trace

.step(name, [tags])

Adds a step to a trace.

.complete()

Completes a trace.

License

MIT

Keywords

FAQs

Package last updated on 15 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc