diff options
author | Diego <diegolparra@gmail.com> | 2014-05-02 22:14:23 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-05-02 22:14:23 -0300 |
commit | 30df67da8c923a3d3f023fa5ed846212b0d9c822 (patch) | |
tree | 538625a913883af9460f513ae6b39c614800310d /kamon-statsd/src/test | |
parent | 3b418cf3f757704dbc979cd156084e2379fb5bec (diff) | |
download | Kamon-30df67da8c923a3d3f023fa5ed846212b0d9c822.tar.gz Kamon-30df67da8c923a3d3f023fa5ed846212b0d9c822.tar.bz2 Kamon-30df67da8c923a3d3f023fa5ed846212b0d9c822.zip |
+ statsd: added kamon counter instrument
Diffstat (limited to 'kamon-statsd/src/test')
-rw-r--r-- | kamon-statsd/src/test/scala/kamon/statsd/StatsDMetricSenderSpec.scala | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kamon-statsd/src/test/scala/kamon/statsd/StatsDMetricSenderSpec.scala b/kamon-statsd/src/test/scala/kamon/statsd/StatsDMetricSenderSpec.scala index 8a61d70e..e736a6a7 100644 --- a/kamon-statsd/src/test/scala/kamon/statsd/StatsDMetricSenderSpec.scala +++ b/kamon-statsd/src/test/scala/kamon/statsd/StatsDMetricSenderSpec.scala @@ -26,6 +26,7 @@ import kamon.metrics.Subscriptions.TickMetricSnapshot import java.lang.management.ManagementFactory import java.net.InetSocketAddress import com.typesafe.config.ConfigFactory +import kamon.metrics.instruments.CounterRecorder class StatsDMetricSenderSpec extends TestKitBase with WordSpecLike with Matchers { implicit lazy val system = ActorSystem("statsd-metric-sender-spec", @@ -96,8 +97,12 @@ class StatsDMetricSenderSpec extends TestKitBase with WordSpecLike with Matchers val firstTestMetricKey = buildMetricKey(firstTestMetricName) val secondTestMetricName = "second-test-metric" val secondTestMetricKey = buildMetricKey(secondTestMetricName) + val thirdTestMetricName = "third-test-metric" + val thirdTestMetricKey = buildMetricKey(thirdTestMetricName) + val firstTestRecorder = HdrRecorder(1000L, 2, Scale.Unit) val secondTestRecorder = HdrRecorder(1000L, 2, Scale.Unit) + val thirdTestRecorder = CounterRecorder() firstTestRecorder.record(10L) firstTestRecorder.record(10L) @@ -106,12 +111,18 @@ class StatsDMetricSenderSpec extends TestKitBase with WordSpecLike with Matchers secondTestRecorder.record(20L) secondTestRecorder.record(21L) + thirdTestRecorder.record(1L) + thirdTestRecorder.record(1L) + thirdTestRecorder.record(1L) + thirdTestRecorder.record(1L) + val udp = setup(Map( firstTestMetricName -> firstTestRecorder.collect(), - secondTestMetricName -> secondTestRecorder.collect())) + secondTestMetricName -> secondTestRecorder.collect(), + thirdTestMetricName -> thirdTestRecorder.collect())) val Udp.Send(data, _, _) = udp.expectMsgType[Udp.Send] - data.utf8String should be(s"$firstTestMetricKey:10|ms|@0.5:11|ms\n$secondTestMetricKey:20|ms:21|ms") + data.utf8String should be(s"$firstTestMetricKey:10|ms|@0.5:11|ms\n$secondTestMetricKey:20|ms:21|ms\n$thirdTestMetricKey:4|c") } } |