diff options
Diffstat (limited to 'kamon-statsd/src/main/scala/kamon/statsd')
3 files changed, 8 insertions, 2 deletions
diff --git a/kamon-statsd/src/main/scala/kamon/statsd/Statsd.scala b/kamon-statsd/src/main/scala/kamon/statsd/Statsd.scala index a3ca910c..c4212092 100644 --- a/kamon-statsd/src/main/scala/kamon/statsd/Statsd.scala +++ b/kamon-statsd/src/main/scala/kamon/statsd/Statsd.scala @@ -20,6 +20,7 @@ import akka.actor._ import kamon.Kamon import kamon.metrics.Subscriptions.TickMetricSnapshot import kamon.metrics.{ TickMetricSnapshotBuffer, CustomMetric, TraceMetrics, Metrics } +import scala.concurrent.duration._ object Statsd extends ExtensionId[StatsdExtension] with ExtensionIdProvider { override def lookup(): ExtensionId[_ <: Extension] = Statsd @@ -50,7 +51,7 @@ class StatsdMetricsListener(host: String, port: Int, prefix: String) extends Act val buffer = context.actorOf(TickMetricSnapshotBuffer.props(1 minute, translator), "statsd-metrics-buffer") def receive = { - case tick: TickMetricSnapshot ⇒ statsdActor.forward(tick) + case tick: TickMetricSnapshot ⇒ buffer.forward(tick) } } diff --git a/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricTranslator.scala b/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricTranslator.scala index 61c39ed7..a08450c5 100644 --- a/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricTranslator.scala +++ b/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricTranslator.scala @@ -16,15 +16,20 @@ package kamon.statsd import akka.actor.{ Props, Actor, ActorRef } +import kamon.metrics._ import kamon.metrics.Subscriptions.TickMetricSnapshot class StatsdMetricTranslator(receiver: ActorRef) extends Actor { def receive = { case TickMetricSnapshot(from, to, metrics) ⇒ + collectAllMetrics(metrics) receiver ! "" } + def collectAllMetrics(metrics: Map[MetricGroupIdentity, MetricGroupSnapshot]) = { + + } } object StatsdMetricTranslator { diff --git a/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricsSender.scala b/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricsSender.scala index c540ad69..96d83eb8 100644 --- a/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricsSender.scala +++ b/kamon-statsd/src/main/scala/kamon/statsd/StatsdMetricsSender.scala @@ -43,7 +43,7 @@ class StatsdMetricsSender(statPrefix: String, remote: InetSocketAddress) extends object StatsdMetricsSender { sealed trait StatsdMetric - + case class Counter(key: String, value: Long = 1, suffix: String = "c", samplingRate: Double = 1.0) extends StatsdMetric case class Timing(key: String, millis: Long, suffix: String = "ms", samplingRate: Double = 1.0) extends StatsdMetric case class Gauge(key: String, value: Long, suffix: String = "g", samplingRate: Double = 1.0) extends StatsdMetric |