Skip to content

benhardy/statsd-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

statsd-scala

A statsd client for scala, ships statistics to a UDP socket

See https://github.com/etsy/statsd

Basic usage

Create a Config with a new UdpMessageSender pointing to the statsd host. Create a new Statsd object with that config. Then reuse that to record stats

import net.bhardy.statsd._

val statsd = Statsd(Config(new UdpMessageSender("localhost", serverPort)))
statsd("chickens").increment

statsd.namespace("reptiles")("lizards").count(5)

statsd.namespace("mammals", "primates")("chimps").increment

// namespace is curried for reuse

val fishStats: String=>StatOperations = statsd.namespace("vertebrates", "fishes")
fishStats("mullet").increment
fishStats("bream").count(5)

Error handling

If for some reason we can't send the stat to the server, an error will be logged to the error handler function in Config. By default this dumps to stderr.

TODOS

  • Sampling
  • Gauges a formatted doubles

BUGS

File 'em on github if you see them

LICENSE

MIT

About

A statsd client for scala, ships statistics to a UDP socket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages