aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala
diff options
context:
space:
mode:
authorIvan Topolnak <ivantopo@gmail.com>2013-07-16 18:40:02 -0300
committerIvan Topolnak <ivantopo@gmail.com>2013-07-16 18:40:02 -0300
commita9f568f562e1c4a358a3f63b3dcce2b38b5e14d6 (patch)
treec6ac11a04d8d65954a8310c359ea8f2014eabbf8 /src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala
parentafda5a6ac02a5cd314638e40250b49f66cf3b419 (diff)
downloadKamon-a9f568f562e1c4a358a3f63b3dcce2b38b5e14d6.tar.gz
Kamon-a9f568f562e1c4a358a3f63b3dcce2b38b5e14d6.tar.bz2
Kamon-a9f568f562e1c4a358a3f63b3dcce2b38b5e14d6.zip
wip
Diffstat (limited to 'src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala')
-rw-r--r--src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala17
1 files changed, 15 insertions, 2 deletions
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")
+ }
+ }))
+
}
}