aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Topolnak <itopolnak@despegar.com>2013-12-23 18:16:36 -0300
committerIvan Topolnak <itopolnak@despegar.com>2013-12-23 18:16:36 -0300
commitf648ccc25197d6a0b604722c78c715a8ef6b59ae (patch)
treefba781ef590b22d296950ddb202f57bdbc5433d4
parentf2a4fcd0a6190d674773228ab9589742955515b9 (diff)
downloadKamon-f648ccc25197d6a0b604722c78c715a8ef6b59ae.tar.gz
Kamon-f648ccc25197d6a0b604722c78c715a8ef6b59ae.tar.bz2
Kamon-f648ccc25197d6a0b604722c78c715a8ef6b59ae.zip
fix kamon repo definition
-rw-r--r--kamon-trace/src/main/scala/akka/actor/ActorSystemMessagePassingTracing.scala4
-rw-r--r--kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorSystemMessagePassingInstrumentationSpec.scala37
-rw-r--r--project/plugins.sbt2
3 files changed, 20 insertions, 23 deletions
diff --git a/kamon-trace/src/main/scala/akka/actor/ActorSystemMessagePassingTracing.scala b/kamon-trace/src/main/scala/akka/actor/ActorSystemMessagePassingTracing.scala
index b6b7b048..6a82782c 100644
--- a/kamon-trace/src/main/scala/akka/actor/ActorSystemMessagePassingTracing.scala
+++ b/kamon-trace/src/main/scala/akka/actor/ActorSystemMessagePassingTracing.scala
@@ -1,7 +1,7 @@
package akka.actor
import org.aspectj.lang.annotation._
-import kamon.trace.{Trace, ContextAware}
+import kamon.trace.{ Trace, ContextAware }
import akka.dispatch.sysmsg.EarliestFirstSystemMessageList
import org.aspectj.lang.ProceedingJoinPoint
@@ -56,7 +56,7 @@ class ActorSystemMessagePassingTracing {
@Around("systemMessageProcessing(messages)")
def aroundSystemMessageInvoke(pjp: ProceedingJoinPoint, messages: EarliestFirstSystemMessageList): Any = {
- if(messages.nonEmpty) {
+ if (messages.nonEmpty) {
val ctx = messages.head.asInstanceOf[ContextAware].traceContext
Trace.withContext(ctx)(pjp.proceed())
diff --git a/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorSystemMessagePassingInstrumentationSpec.scala b/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorSystemMessagePassingInstrumentationSpec.scala
index a845ad0c..7d539370 100644
--- a/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorSystemMessagePassingInstrumentationSpec.scala
+++ b/kamon-trace/src/test/scala/kamon/trace/instrumentation/ActorSystemMessagePassingInstrumentationSpec.scala
@@ -1,17 +1,16 @@
package kamon.trace.instrumentation
-import akka.testkit.{ImplicitSender, TestKit}
+import akka.testkit.{ ImplicitSender, TestKit }
import akka.actor._
import org.scalatest.WordSpecLike
import kamon.trace.Trace
import scala.util.control.NonFatal
-import akka.actor.SupervisorStrategy.{Escalate, Stop, Restart, Resume}
+import akka.actor.SupervisorStrategy.{ Escalate, Stop, Restart, Resume }
import scala.concurrent.duration._
class ActorSystemMessagePassingInstrumentationSpec extends TestKit(ActorSystem("actor-message-passing-tracing-spec")) with WordSpecLike with ImplicitSender {
implicit val executionContext = system.dispatcher
-
"the system message passing instrumentation" should {
"keep the TraceContext while processing the Create message in top level actors" in new TraceContextFixture {
Trace.withContext(testTraceContext) {
@@ -19,24 +18,23 @@ class ActorSystemMessagePassingInstrumentationSpec extends TestKit(ActorSystem("
testActor ! Trace.context()
- def receive: Actor.Receive = { case any => }
+ def receive: Actor.Receive = { case any ⇒ }
}))
}
expectMsg(testTraceContext)
}
-
"keep the TraceContext while processing the Create message in non top level actors" in new TraceContextFixture {
Trace.withContext(testTraceContext) {
system.actorOf(Props(new Actor {
def receive: Actor.Receive = {
- case any =>
+ case any ⇒
context.actorOf(Props(new Actor {
testActor ! Trace.context()
- def receive: Actor.Receive = { case any => }
+ def receive: Actor.Receive = { case any ⇒ }
}))
}
})) ! "any"
@@ -45,7 +43,6 @@ class ActorSystemMessagePassingInstrumentationSpec extends TestKit(ActorSystem("
expectMsg(testTraceContext)
}
-
"keep the TraceContext in the supervision cycle" when {
"the actor is resumed" in new TraceContextFixture {
val supervisor = supervisorWithDirective(Resume)
@@ -106,16 +103,16 @@ class ActorSystemMessagePassingInstrumentationSpec extends TestKit(ActorSystem("
}
def supervisorWithDirective(directive: SupervisorStrategy.Directive, sendPreRestart: Boolean = false, sendPostRestart: Boolean = false,
- sendPostStop: Boolean = false, sendPreStart: Boolean = false): ActorRef = {
+ sendPostStop: Boolean = false, sendPreStart: Boolean = false): ActorRef = {
class GrandParent extends Actor {
val child = context.actorOf(Props(new Parent))
override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() {
- case NonFatal(throwable) => testActor ! Trace.context(); Stop
+ case NonFatal(throwable) ⇒ testActor ! Trace.context(); Stop
}
def receive = {
- case any => child forward any
+ case any ⇒ child forward any
}
}
@@ -123,42 +120,42 @@ class ActorSystemMessagePassingInstrumentationSpec extends TestKit(ActorSystem("
val child = context.actorOf(Props(new Child))
override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() {
- case NonFatal(throwable) => testActor ! Trace.context(); directive
+ case NonFatal(throwable) ⇒ testActor ! Trace.context(); directive
}
def receive: Actor.Receive = {
- case any => child forward any
+ case any ⇒ child forward any
}
override def postStop(): Unit = {
- if(sendPostStop) testActor ! Trace.context()
+ if (sendPostStop) testActor ! Trace.context()
super.postStop()
}
}
class Child extends Actor {
def receive = {
- case "fail" => 1/0
- case "context" => sender ! Trace.context()
+ case "fail" ⇒ 1 / 0
+ case "context" ⇒ sender ! Trace.context()
}
override def preRestart(reason: Throwable, message: Option[Any]): Unit = {
- if(sendPreRestart) testActor ! Trace.context()
+ if (sendPreRestart) testActor ! Trace.context()
super.preRestart(reason, message)
}
override def postRestart(reason: Throwable): Unit = {
- if(sendPostRestart) testActor ! Trace.context()
+ if (sendPostRestart) testActor ! Trace.context()
super.postRestart(reason)
}
override def postStop(): Unit = {
- if(sendPostStop) testActor ! Trace.context()
+ if (sendPostStop) testActor ! Trace.context()
super.postStop()
}
override def preStart(): Unit = {
- if(sendPreStart) testActor ! Trace.context()
+ if (sendPreStart) testActor ! Trace.context()
super.preStart()
}
}
diff --git a/project/plugins.sbt b/project/plugins.sbt
index a260b165..ee0b967c 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,6 +1,6 @@
resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
-resolvers += Resolver.url("Kamon Releases", url("http://repo.kamon.io"))(Resolver.ivyStylePatterns)
+resolvers += "Kamon Releases" at "http://repo.kamon.io"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1")