aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala
diff options
context:
space:
mode:
authorIvan Topolnak <ivantopo@gmail.com>2013-08-07 19:06:33 -0300
committerIvan Topolnak <ivantopo@gmail.com>2013-08-07 19:06:33 -0300
commitcd1a9dd25fb550a515e7a7408b88233773268c38 (patch)
tree98c16e292c533cc9aa51bb0f073864b1f9e2b68a /kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala
parent6566e1c41510e54dd987d3e34e40f1031169d592 (diff)
downloadKamon-cd1a9dd25fb550a515e7a7408b88233773268c38.tar.gz
Kamon-cd1a9dd25fb550a515e7a7408b88233773268c38.tar.bz2
Kamon-cd1a9dd25fb550a515e7a7408b88233773268c38.zip
upgrading to akka 2.2
Diffstat (limited to 'kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala')
-rw-r--r--kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala34
1 files changed, 34 insertions, 0 deletions
diff --git a/kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala b/kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala
new file mode 100644
index 00000000..89ef61f3
--- /dev/null
+++ b/kamon-core/src/test/scala/kamon/instrumentation/DispatcherInstrumentationSpec.scala
@@ -0,0 +1,34 @@
+package kamon.instrumentation
+
+import org.scalatest.{Matchers, WordSpec}
+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 new SingleDispatcherActorSystem {
+ val x = Kamon.Metric.actorSystem("single-dispatcher").get.dispatchers
+ (1 to 10).foreach(actor ! _)
+
+ val active = x.get("akka.actor.default-dispatcher").get.activeThreadCount.snapshot
+ println("Active max: "+active.max)
+ println("Active min: "+active.min)
+
+ }
+ }
+
+
+ trait SingleDispatcherActorSystem {
+ val actorSystem = ActorSystem("single-dispatcher")
+ val actor = actorSystem.actorOf(Props(new Actor {
+ def receive = {
+ case a => sender ! a;
+ }
+ }))
+
+ }
+}
+