diff options
Diffstat (limited to 'src/test/scala')
-rw-r--r-- | src/test/scala/kamon/instrumentation/ActorSystemInstrumentationSpec.scala | 3 | ||||
-rw-r--r-- | src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala | 17 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/test/scala/kamon/instrumentation/ActorSystemInstrumentationSpec.scala b/src/test/scala/kamon/instrumentation/ActorSystemInstrumentationSpec.scala index 489f3c1c..1eab6355 100644 --- a/src/test/scala/kamon/instrumentation/ActorSystemInstrumentationSpec.scala +++ b/src/test/scala/kamon/instrumentation/ActorSystemInstrumentationSpec.scala @@ -16,8 +16,7 @@ class ActorSystemInstrumentationSpec extends WordSpec with Matchers { Kamon.Metric.actorSystem("as1") should not be (None) Kamon.Metric.actorSystem("as2") should not be (None) - /*assert(Kamon.Metric.actorSystem("as2") != null) - assert(Kamon.Metric.actorSystem("as3") === null)*/ + Kamon.Metric.actorSystem("unknown") should be (None) } } } diff --git a/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala b/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala index d72989f6..7a14af6c 100644 --- a/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala +++ b/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala @@ -1,14 +1,21 @@ package kamon.instrumentation import org.scalatest.{Matchers, WordSpec} -import akka.actor.ActorSystem +import akka.actor.{Actor, Props, ActorSystem} import kamon.metric.MetricDirectory +import kamon.Kamon class DispatcherInstrumentationSpec extends WordSpec with Matchers{ "the dispatcher instrumentation" should { - "instrument a dispatcher that belongs to a non-filtered actor system" in { + "instrument a dispatcher that belongs to a non-filtered actor system" in new SingleDispatcherActorSystem { + val x = Kamon.Metric.actorSystem("single-dispatcher").get.dispatchers + (1 to 10).foreach(actor ! _) + + val active = x.get("akka.actor.default-dispatcher").activeThreadCount.snapshot + println("Active max: "+active.max) + println("Active min: "+active.min) } } @@ -16,6 +23,12 @@ class DispatcherInstrumentationSpec extends WordSpec with Matchers{ trait SingleDispatcherActorSystem { val actorSystem = ActorSystem("single-dispatcher") + val actor = actorSystem.actorOf(Props(new Actor { + def receive = { + case a => sender ! a; println("BAAAANG") + } + })) + } } |