0.1.0-rc0 • Published 4 years ago

@kanziw/statsd-client v0.1.0-rc0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

StatsDClient

StatsDClient for InfluxDB
Inspired by statsd-client & hot-shots

Installation

$ npm install @kanziw/statsd-client

API

Initialization

import StatsDClient from '@kanziw/statsd-client'

const statsDClient = new StatsDClient({ host: 'statsd.example.com', port: 8125 });

Global options:

  • prefix: Prefix all stats with this value (default "").

Counting stuff

Counters are supported, both as raw .counter(metric, delta) and with the shortcuts .increment(metric, [delta=1]):

statsDClient.counter('measurements.path', 100) // Increment by 100
statsDClient.increment('measurements.path') // Increment by one

Tags

All the methods above support metric level tags as their last argument. Tags is an object of string key/value pairs:

statsDClient.counter('measurements.path', 100, { tagKey: tagValue })
statsDClient.increment('measurements.path', 1, { tagKey: tagValue }) // Should write delta
0.1.0-rc0

4 years ago

0.0.1-rc

4 years ago

0.0.1

4 years ago