diff options
author | Diego <diegolparra@gmail.com> | 2014-03-31 23:34:22 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-03-31 23:34:22 -0300 |
commit | 32ba2d5253994e898b9f611870b401aafe4779bb (patch) | |
tree | 749e76e7eeb6355f96c591cd016d4540b4e0499e /kamon-statsd/src/main/scala/kamon/statsd/client/StatsdClient.scala | |
parent | 503752564267d784b15d3b0d12e45a3c190fdd54 (diff) | |
download | Kamon-32ba2d5253994e898b9f611870b401aafe4779bb.tar.gz Kamon-32ba2d5253994e898b9f611870b401aafe4779bb.tar.bz2 Kamon-32ba2d5253994e898b9f611870b401aafe4779bb.zip |
first implementation statsd client
Diffstat (limited to 'kamon-statsd/src/main/scala/kamon/statsd/client/StatsdClient.scala')
-rw-r--r-- | kamon-statsd/src/main/scala/kamon/statsd/client/StatsdClient.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kamon-statsd/src/main/scala/kamon/statsd/client/StatsdClient.scala b/kamon-statsd/src/main/scala/kamon/statsd/client/StatsdClient.scala new file mode 100644 index 00000000..23376558 --- /dev/null +++ b/kamon-statsd/src/main/scala/kamon/statsd/client/StatsdClient.scala @@ -0,0 +1,22 @@ +package kamon.statsd.client + +import akka.actor.{ActorRef, Actor} +import akka.io.{Udp, IO} +import java.net.InetSocketAddress +import akka.util.ByteString + +class StatsdClient(remote: InetSocketAddress) extends Actor { + import context.system + + IO(Udp) ! Udp.SimpleSender + + def receive = { + case Udp.SimpleSenderReady => + context.become(ready(sender())) + } + + def ready(send: ActorRef): Receive = { + case msg: String => + send ! Udp.Send(ByteString(msg), remote) + } +}
\ No newline at end of file |