Fixed warnings in akka-bench-jmh-typed (#27435)

This commit is contained in:
Helena Edelson 2019-08-02 14:02:51 -07:00 committed by GitHub
parent d12bc13fcb
commit 473d4f71d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 14 deletions

View file

@ -54,7 +54,7 @@ class TypedActorBenchmark {
def setup(): Unit = {
akka.actor.BenchmarkActors.requireRightNumberOfCores(threads)
system = ActorSystem(
TypedBenchmarkActors.echoActorsSupervisor(numMessagesPerActorPair, numActors, dispatcher, batchSize, timeout),
TypedBenchmarkActors.echoActorsSupervisor(numMessagesPerActorPair, numActors, dispatcher, batchSize),
"TypedActorBenchmark",
ConfigFactory.parseString(s"""
akka.actor {

View file

@ -6,12 +6,12 @@ package akka.actor.typed
import java.util.concurrent.CountDownLatch
import scala.concurrent.duration._
import akka.Done
import akka.actor.typed.scaladsl.ActorContext
import akka.actor.typed.scaladsl.Behaviors
import scala.concurrent.duration._
object TypedBenchmarkActors {
// to avoid benchmark to be dominated by allocations of message
@ -65,8 +65,7 @@ object TypedBenchmarkActors {
numMessagesPerActorPair: Int,
numActors: Int,
dispatcher: String,
batchSize: Int,
shutdownTimeout: FiniteDuration): Behavior[Start] =
batchSize: Int): Behavior[Start] =
Behaviors.receive { (ctx, msg) =>
msg match {
case Start(respondTo) =>
@ -146,11 +145,9 @@ object TypedBenchmarkActors {
private def initiatePingPongForPairs(refs: Vector[(ActorRef[Message], ActorRef[Message])], inFlight: Int): Unit = {
for {
(ping, pong) <- refs
val message = Message(pong) // just allocate once
message = Message(pong) // just allocate once
_ <- 1 to inFlight
} {
ping ! message
}
} ping ! message
}
private def startPingPongActorPairs(

View file

@ -17,11 +17,8 @@ object AkkaDisciplinePlugin extends AutoPlugin with ScalafixSupport {
override def requires: Plugins = JvmPlugin && ScalafixPlugin
override lazy val projectSettings = disciplineSettings
val nonFatalWarningsFor = Set(
// We allow warnings in docs to get the 'snippets' right
"akka-docs",
// To be reviewed
"akka-bench-jmh-typed")
// We allow warnings in docs to get the 'snippets' right
val nonFatalWarningsFor = Set("akka-docs")
val strictProjects = Set("akka-discovery", "akka-protobuf", "akka-coordination")