Skip to content

themodernlife/akka-statsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

akka-statsd

ActorExtension for sending info to StatsD. Heavily inspired by the Play StatsD Plugin.

application.conf:

akka {
  statsd {
		prefix   = example-akka-app
		hostname = statsd.example.com
		port     = 8125
	}
}

ExampleActor.scala:

class ExampleActor extends Actor with StatsD {
	receieve = {
		case Like                 statsd.counter("likes")             // increment by 1
		case Paycheck(cash)       statsd.counter("balance", cash)     // increment by a fixed amount
		case TableReady(howlong)  statsd.timing("reso-time", howlong) // send timing
		case Temp(howhot)         statsd.gauge("temperature", howhot) // update a gauge
	}
}

The counter and timing methods also support a sampling percentage if you don't want to send every event.

About

ActorExtension for sending info to StatsD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages