From 945440a38d437fa252e67089da020f695cd5c0b4 Mon Sep 17 00:00:00 2001 From: Christopher Batey Date: Mon, 30 Apr 2018 14:58:33 +0100 Subject: [PATCH] Revert "Look for perf-java-flames on path in MultiJVM perf support" (#25022) * Revert "Look for perf-java-flames on path in MultiJVM perf support (#25003)" This reverts commit 3e11092388d99649465ff64542f9e60b96849864. --- .../mima-filters/2.5.12.backwards.excludes | 2 -- .../remote/testkit/PerfFlamesSupport.scala | 20 +++++++-------- .../remote/artery/FanInThrougputSpec.scala | 25 +++++++++++++------ 3 files changed, 26 insertions(+), 21 deletions(-) delete mode 100644 akka-multi-node-testkit/src/main/mima-filters/2.5.12.backwards.excludes diff --git a/akka-multi-node-testkit/src/main/mima-filters/2.5.12.backwards.excludes b/akka-multi-node-testkit/src/main/mima-filters/2.5.12.backwards.excludes deleted file mode 100644 index e1e2763ae8..0000000000 --- a/akka-multi-node-testkit/src/main/mima-filters/2.5.12.backwards.excludes +++ /dev/null @@ -1,2 +0,0 @@ -# Internal API changes -ProblemFilters.exclude[DirectMissingMethodProblem]("akka.remote.testkit.PerfFlamesSupport.perfJavaFlamesPath") \ No newline at end of file diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/PerfFlamesSupport.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/PerfFlamesSupport.scala index 5933f29cde..8d1aaebbc3 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/PerfFlamesSupport.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testkit/PerfFlamesSupport.scala @@ -4,18 +4,13 @@ package akka.remote.testkit -import PerfFlamesSupport._ +import java.io.File + import akka.remote.testconductor.RoleName import scala.concurrent.Future import scala.concurrent.duration._ -import scala.language.postfixOps - -object PerfFlamesSupport { - val Command = "perf-java-flames" -} - /** * INTERNAL API: Support trait allowing trivially recording perf metrics from [[MultiNodeSpec]]s */ @@ -37,7 +32,7 @@ private[akka] trait PerfFlamesSupport { _: MultiNodeSpec ⇒ val name = ManagementFactory.getRuntimeMXBean.getName val pid = name.substring(0, name.indexOf('@')).toInt - val perfCommand = s"$Command $pid" + val perfCommand = s"$perfJavaFlamesPath $pid" println(s"[perf @ $myself($pid)][OUT]: " + perfCommand) import scala.sys.process._ @@ -50,10 +45,13 @@ private[akka] trait PerfFlamesSupport { _: MultiNodeSpec ⇒ } } + def perfJavaFlamesPath: String = + "/home/ubuntu/perf-java-flames" + def isPerfJavaFlamesAvailable: Boolean = { - import scala.sys.process._ - val isIt = (s"type $Command" !) == 0 - if (!isIt) println(s"WARN: perf-java-flames not on the path! Skipping perf profiling.") + val isIt = new File(perfJavaFlamesPath).exists() + if (!isIt) println(s"WARN: perf-java-flames not available under [$perfJavaFlamesPath]! Skipping perf profiling.") isIt } + } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/FanInThrougputSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/FanInThrougputSpec.scala index 3845b74774..869e20962f 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/FanInThrougputSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/artery/FanInThrougputSpec.scala @@ -4,17 +4,26 @@ package akka.remote.artery +import java.nio.ByteBuffer +import java.text.SimpleDateFormat +import java.util.Date import java.util.concurrent.Executors - -import akka.actor._ -import akka.remote.artery.MaxThroughputSpec._ -import akka.remote.testconductor.RoleName -import akka.remote.testkit.{ MultiNodeConfig, PerfFlamesSupport } -import akka.remote.{ RemoteActorRefProvider, RemotingMultiNodeSpec } -import akka.testkit._ -import com.typesafe.config.ConfigFactory +import java.util.concurrent.TimeUnit.NANOSECONDS import scala.concurrent.duration._ +import akka.actor._ +import akka.remote.{ RARP, RemoteActorRefProvider, RemotingMultiNodeSpec } +import akka.remote.testconductor.RoleName +import akka.remote.testkit.MultiNodeConfig +import akka.remote.testkit.MultiNodeSpec +import akka.remote.testkit.PerfFlamesSupport +import akka.remote.testkit.STMultiNodeSpec +import akka.serialization.ByteBufferSerializer +import akka.serialization.SerializerWithStringManifest +import akka.testkit._ +import com.typesafe.config.ConfigFactory +import akka.remote.artery.compress.CompressionProtocol.Events.ReceivedActorRefCompressionTable +import akka.remote.artery.MaxThroughputSpec._ object FanInThroughputSpec extends MultiNodeConfig { val totalNumberOfNodes =