dog-statsy
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/dog-statsy package

1.3.1 • Public • Published

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

Package Sidebar

Install

npm i dog-statsy

Weekly Downloads

2,403

Version

1.3.1

License

MIT

Unpacked Size

15.2 kB

Total Files

7

Last publish

Collaborators

  • gaprabhu
  • poojapatilseg
  • andwivedi
  • vikakumar
  • yshkpr
  • priyanshis
  • jbasiglio-segment
  • pragupta
  • sbhodiwal
  • sahilsharma0709
  • farhan0581
  • jkusa_segment
  • harksingh
  • arjunbhandage
  • y.yu
  • slenin-twilio
  • skondamuri
  • nithan-twilio
  • praveenugiri
  • bnakkina
  • hema-bahirwani-segment
  • sandhya16
  • nemery-segment
  • ighorela
  • mansari
  • bhavanki-segment
  • ar7dev
  • vaibhavnanda
  • nikumarsegment
  • itsarijitray
  • ssuneja
  • azhaotwilio
  • ldelossantos
  • cjo2
  • achandrashekaran
  • aparna.singhal
  • ynguyen
  • timmyzsearcy
  • igracheva-twilio
  • yashnit-segment
  • nanotimm
  • srivig21
  • chenchensegmentcom
  • sanket.mishra
  • lweimersegment
  • rcheedhalla
  • jxin_twilio
  • odoren_segment
  • aditi.raveesh
  • dltnbrks-segment
  • sai-patanjali
  • himanshuph
  • alecjacobs-segment
  • sshaikh_segment
  • john.lee1100
  • dazu70
  • brian.aguirre
  • pooja.patil
  • segment_fan
  • nlubchenco
  • jsh-wu
  • nithin-benny
  • poojasegment
  • ebru.odok
  • bannapple
  • rodhilton_twilio
  • guthriesegment
  • srishti-nema
  • cdelaomartinez
  • miguelpdiaz8
  • sundareswar.jayakumar
  • gbatra
  • spencerattick
  • akodankiry
  • nanette.ranes
  • gsolis_segment
  • nitinpm432
  • amigandhi
  • segmentsean
  • hmohanram_seg
  • jrupasinghe
  • devthale
  • smccoy-twilio
  • seg-leonelsanches
  • jibrang
  • sethgrid_segment
  • light-bringer-blr
  • aubreysine
  • ed-twilion-npm
  • harsh-joshi99
  • irfan.ali.segment
  • kbhargavaram-sg
  • needcaffeine
  • nat-grid
  • wlumsegment
  • moyara2
  • bala.singareddy
  • akash.gautam07
  • preetyp
  • viveksainaneesegment
  • msaraf
  • kjoerres
  • rokatyal
  • ainatancinco
  • anton-vylushchak
  • sowjanyasegment
  • alayvora
  • tw-dgarcia
  • parag.panda
  • blangtwilio
  • ryanrouleau-segment
  • twjosiah
  • mcullenmeyer
  • david.anusontarangkul.segment
  • mckern_segment
  • segment-admin
  • nainy.agrawal
  • tdibacco
  • sudojatin
  • nageshgolem
  • brandonheyer-segment
  • alfrimpong
  • dobrin.ganev
  • ankit.gupta.unthinkable
  • marinhero
  • benattwilio
  • bharath.boregowda
  • conniechen
  • sungju.jin
  • pooyaj
  • yli119
  • ea_segment
  • emilyjia
  • kx-segment
  • xinghao.huang
  • harsh.vardhan
  • joe.ayoub.segment
  • gkochar123
  • rollcode
  • ariel.silvestri
  • cherylj-segment
  • immanoj
  • aaronklish
  • michelr
  • maneesh.dharma29
  • brianhumphreystwilio
  • jfehrman.segment
  • joetessy
  • pmunin
  • jalexy12
  • jbandi-twilio
  • prayansh-twilio
  • dominicbarnes
  • brandon.scott-segment
  • bgillan
  • phillip.thomas
  • ricardo.rossi
  • forgetfulfellow
  • fauzy.yy
  • mayur-pitale
  • dbaik-twilio-segment
  • seg-rustybailey
  • tanya.gupta.segment
  • pmiller-twilio
  • nevermore2022
  • aishikawaki
  • csayuso
  • mcoulibali
  • shupadhyay
  • jahood-twilio
  • saisagarkappaganthula
  • rmukundan
  • arubiochavez
  • shuvrajit9904
  • s3gm3nt
  • ama0223
  • tbrennanj
  • dangmai-segment
  • shraddha-twilio
  • sa-jsooter
  • enyi.asonye
  • afsha-nazim-seg
  • mschaszberger
  • lnamba
  • varadarajan-tw
  • seanhan-segment
  • replatero
  • sayan-das-in
  • justeen
  • jgabe13
  • meg1000
  • funlu
  • ashwitha.bg
  • whaider_twilio
  • tcgilbert
  • kevinburkesegment
  • felttrip
  • prabhnoor1997
  • akashyap91
  • clintz.seg
  • karimkeshwani
  • wally.tg
  • rhall-twilio
  • yash-twilio
  • brookstaylorjr
  • shayan-golafshani
  • lerahulram
  • mugelstad
  • rrivera-segment
  • sethnutetwilio
  • manali-bhosale
  • chtoombs
  • sethsegment
  • eric-hyde
  • elmoselyee
  • michaelghseg
  • jayakrishnannair
  • lateefat
  • maryam.sharif
  • wdbetts
  • ryanligon
  • sindhusegment
  • lfdelossantos
  • vbatanov
  • lluque-twilio
  • jair.aviles
  • pmaid
  • song4you
  • peterdemartini
  • emmy.byrne
  • vincen7tran
  • dean-huynh
  • cdignam-segment
  • abhinavsureka
  • arunlalam-segment
  • neeharikakondipati
  • simpixelated
  • chihchun-twilio
  • acharles14
  • jyim008
  • fhalim-segment
  • cfree
  • hjoonpm
  • celine-segment
  • pmcanseco-segment
  • masira
  • amillet89
  • cholt002
  • av-segment
  • aghotikar
  • vikrant-segment
  • larryatsegment
  • scruwys1
  • kyliepedersen
  • jinapark
  • segmentio
  • rajulvadera
  • lpediredla
  • n2parko
  • tyson_segment
  • bgamwell
  • salolivares
  • erikdw
  • chenxiangzhang
  • mericsson
  • prayansh-segmentt
  • jeremylarkin
  • bsneed
  • danieljackins
  • segment-seth
  • james9446
  • priscilla.giatti
  • nlsun
  • drew-thompson
  • segment-jsingh
  • andrius-segment
  • valerieernst
  • gilomer
  • marcelopv
  • eric.rogner
  • kdharaiya
  • jon.anderson-at-segment.com
  • stacy.song
  • rexatsegment
  • nickaguilar
  • bradenbecker
  • reneewang
  • dan.lasky
  • sam.tapia
  • vikramkumar19
  • mpriyad25
  • jeremy.parker
  • smidges