From 81ae33c18c7d875240db1b2bbf8fcb2d6e41ca47 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Thu, 23 Oct 2014 20:15:56 +0200 Subject: = core: minor cleanup of the remoting instrumentation --- .../instrumentation/akka/RemotingInstrumentation.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala index 341b0ee7..00747935 100644 --- a/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala +++ b/kamon-core/src/main/scala/kamon/instrumentation/akka/RemotingInstrumentation.scala @@ -1,20 +1,19 @@ package akka.remote.instrumentation import akka.actor.{ ActorRef, Address } -import akka.dispatch.sysmsg.SystemMessage import akka.remote.instrumentation.TraceContextAwareWireFormats.{ TraceContextAwareRemoteEnvelope, RemoteTraceContext, AckAndTraceContextAwareEnvelopeContainer } -import akka.remote.transport.AkkaPduCodec.Message import akka.remote.{ RemoteActorRefProvider, Ack, SeqNo } import akka.remote.WireFormats._ import akka.util.ByteString -import kamon.trace.{ TraceContextAware, TraceRecorder } +import kamon.trace.TraceRecorder import org.aspectj.lang.ProceedingJoinPoint import org.aspectj.lang.annotation._ @Aspect class RemotingInstrumentation { - @Pointcut("execution(* akka.remote.transport.AkkaPduProtobufCodec$.constructMessage(..)) && args(localAddress, recipient, serializedMessage, senderOption, seqOption, ackOption)") + @Pointcut("execution(* akka.remote.transport.AkkaPduProtobufCodec$.constructMessage(..)) && " + + "args(localAddress, recipient, serializedMessage, senderOption, seqOption, ackOption)") def constructAkkaPduMessage(localAddress: Address, recipient: ActorRef, serializedMessage: SerializedMessage, senderOption: Option[ActorRef], seqOption: Option[SeqNo], ackOption: Option[Ack]): Unit = {} @@ -56,7 +55,8 @@ class RemotingInstrumentation { // Copied from akka.remote.transport.AkkaPduProtobufCodec because of private access. private def serializeActorRef(defaultAddress: Address, ref: ActorRef): ActorRefData = { ActorRefData.newBuilder.setPath( - if (ref.path.address.host.isDefined) ref.path.toSerializationFormat else ref.path.toSerializationFormatWithAddress(defaultAddress)).build() + if (ref.path.address.host.isDefined) ref.path.toSerializationFormat + else ref.path.toSerializationFormatWithAddress(defaultAddress)).build() } // Copied from akka.remote.transport.AkkaPduProtobufCodec because of private access. @@ -71,8 +71,8 @@ class RemotingInstrumentation { case _ ⇒ throw new IllegalArgumentException(s"Address [${address}] could not be serialized: host or port missing.") } - @Pointcut("execution(* akka.remote.transport.AkkaPduProtobufCodec$.decodeMessage(..)) && args(bs, provider, localAddress)") // && args(raw, provider, localAddress)") - def decodeRemoteMessage(bs: ByteString, provider: RemoteActorRefProvider, localAddress: Address): Unit = {} //(raw: ByteString, provider: RemoteActorRefProvider, localAddress: Address): Unit = {} + @Pointcut("execution(* akka.remote.transport.AkkaPduProtobufCodec$.decodeMessage(..)) && args(bs, provider, localAddress)") + def decodeRemoteMessage(bs: ByteString, provider: RemoteActorRefProvider, localAddress: Address): Unit = {} @Around("decodeRemoteMessage(bs, provider, localAddress)") def aroundDecodeRemoteMessage(pjp: ProceedingJoinPoint, bs: ByteString, provider: RemoteActorRefProvider, localAddress: Address): AnyRef = { -- cgit v1.2.3