dog-statsy

    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

    Install

    npm i dog-statsy

    DownloadsWeekly Downloads

    272

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    15.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • seghungtran
    • alayvora
    • tv0
    • pchen-twilio
    • hema-segment
    • sudojatin
    • mkhan-twilio
    • mayberex
    • anandjha
    • pmunin
    • oscb
    • krousseau
    • brandongregoryscott
    • knksmith57
    • sachinwathore
    • fhalim-segment
    • cfree
    • mettledrum
    • 5t0k4st1k
    • maerf0x0
    • gnijor
    • ifonseka1
    • aniket.gupta
    • hjoonpm
    • lauramunozjimenez
    • celine-segment
    • parsa-segment
    • hmorgan94
    • pmcanseco-segment
    • ynguyen
    • mshwery
    • debajitr
    • masira
    • gpsamson
    • amillet89
    • cholt002
    • av-segment
    • aghotikar
    • vikrant-segment
    • ankur.agarwal
    • larryatsegment
    • lbrink
    • shivpoojan-segment
    • ariel_segment
    • zkuzmic-segment
    • scruwys1
    • sowjanyaedara
    • chrischalstrom
    • rossedfort
    • eesegment
    • lew-gordon
    • kyliepedersen
    • jinapark
    • skntwilio
    • segmentio
    • segment-admin
    • dominicbarnes
    • shobhita-agarwal
    • deanhuynh
    • jlineaweaver
    • ladanazita
    • anoonan
    • peripheral
    • achille-roussel
    • rajulvadera
    • nettofarah
    • dalchandc
    • lpediredla
    • albert.segment
    • segment-danielstjules
    • n2parko
    • segment-andy-yeo
    • sahilp
    • psankaranarayana
    • vdemedes
    • emilio-gomez-lavin
    • andreiko_ru
    • xagos
    • leifdreizler
    • alan-segment
    • tyson_segment
    • bgamwell
    • jfabre-segment
    • uditmehta
    • hellooimkat
    • brienne.mcnally
    • sanscontext
    • eculver
    • aultimus
    • salolivares
    • erikdw
    • chenxiangzhang
    • fauzyy
    • jaimal
    • davidbirdsong
    • ktrinh
    • calthomson
    • yunqiaohuang
    • dk1027
    • nielssegment
    • cdrycroft
    • yabrira
    • julee05
    • kamebkj
    • ryan_segment
    • laurenmreeder
    • tidothegreat
    • mericsson
    • prayansh-segmentt
    • stargaesser
    • andyguwc
    • jeremylarkin
    • bsneed
    • danieljackins
    • tomeliaz
    • segment-seth
    • bihl
    • shamil.ataev
    • james9446
    • priscilla.giatti
    • kellylu
    • smokeybears
    • jmbuckner
    • benhorowitz
    • yolken-segment
    • nlsun
    • thomas-pelletier-segment
    • brian-segment
    • segment-michael
    • cohara87
    • drew-thompson
    • segment-jsingh
    • vanesng
    • cvillela
    • pauljaeinyoo
    • mniehe
    • stephment
    • sharadbhadouria
    • emilyc
    • maggieyu
    • anoonan16
    • durgani
    • julio.farah
    • hblanks-segment
    • rsata
    • shyaan
    • juhaelee
    • akleiner2
    • kathryn-taylor
    • andrius-segment
    • pooyaj
    • llbsgmt
    • lab176
    • valerieernst
    • ucarion
    • solon.aguiar
    • rjenkinsseg
    • segment-ulysse
    • khinkalilover
    • maloneya
    • zackurey
    • kelcook
    • arta.razavi
    • odoren
    • alistairbarrell
    • anna.choi
    • whamo12
    • amaloney
    • gilomer
    • kiara.daswani
    • marcelopv
    • yannieyip
    • eric.rogner
    • marinhero
    • lcamposg
    • corey.ching
    • steve_at_segment
    • tepahk
    • sorrel.j
    • cjo2
    • fc-segment
    • kdharaiya
    • warrengreen
    • jon.anderson-at-segment.com
    • markzegarelli
    • stysegment
    • ajhenry
    • stacy.song
    • niveda.balananthan
    • collinvandyck
    • krlv
    • rexatsegment
    • nickaguilar
    • tri.truong
    • csayuso
    • joyce-shi
    • bradenbecker
    • neha.sanghrajka
    • reneewang
    • dan.lasky
    • sam.tapia
    • gbbastos
    • vikramkumar19
    • mpriyad25
    • peter.walker
    • jeremy.parker
    • khamidou-segment
    • smidges
    • daltonscharff