Fixed warnings in akka-bench-jmh-typed (#27435)
This commit is contained in:
parent
d12bc13fcb
commit
473d4f71d7
3 changed files with 8 additions and 14 deletions
|
|
@ -54,7 +54,7 @@ class TypedActorBenchmark {
|
||||||
def setup(): Unit = {
|
def setup(): Unit = {
|
||||||
akka.actor.BenchmarkActors.requireRightNumberOfCores(threads)
|
akka.actor.BenchmarkActors.requireRightNumberOfCores(threads)
|
||||||
system = ActorSystem(
|
system = ActorSystem(
|
||||||
TypedBenchmarkActors.echoActorsSupervisor(numMessagesPerActorPair, numActors, dispatcher, batchSize, timeout),
|
TypedBenchmarkActors.echoActorsSupervisor(numMessagesPerActorPair, numActors, dispatcher, batchSize),
|
||||||
"TypedActorBenchmark",
|
"TypedActorBenchmark",
|
||||||
ConfigFactory.parseString(s"""
|
ConfigFactory.parseString(s"""
|
||||||
akka.actor {
|
akka.actor {
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ package akka.actor.typed
|
||||||
|
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
|
|
||||||
|
import scala.concurrent.duration._
|
||||||
|
|
||||||
import akka.Done
|
import akka.Done
|
||||||
import akka.actor.typed.scaladsl.ActorContext
|
import akka.actor.typed.scaladsl.ActorContext
|
||||||
import akka.actor.typed.scaladsl.Behaviors
|
import akka.actor.typed.scaladsl.Behaviors
|
||||||
|
|
||||||
import scala.concurrent.duration._
|
|
||||||
|
|
||||||
object TypedBenchmarkActors {
|
object TypedBenchmarkActors {
|
||||||
|
|
||||||
// to avoid benchmark to be dominated by allocations of message
|
// to avoid benchmark to be dominated by allocations of message
|
||||||
|
|
@ -65,8 +65,7 @@ object TypedBenchmarkActors {
|
||||||
numMessagesPerActorPair: Int,
|
numMessagesPerActorPair: Int,
|
||||||
numActors: Int,
|
numActors: Int,
|
||||||
dispatcher: String,
|
dispatcher: String,
|
||||||
batchSize: Int,
|
batchSize: Int): Behavior[Start] =
|
||||||
shutdownTimeout: FiniteDuration): Behavior[Start] =
|
|
||||||
Behaviors.receive { (ctx, msg) =>
|
Behaviors.receive { (ctx, msg) =>
|
||||||
msg match {
|
msg match {
|
||||||
case Start(respondTo) =>
|
case Start(respondTo) =>
|
||||||
|
|
@ -146,11 +145,9 @@ object TypedBenchmarkActors {
|
||||||
private def initiatePingPongForPairs(refs: Vector[(ActorRef[Message], ActorRef[Message])], inFlight: Int): Unit = {
|
private def initiatePingPongForPairs(refs: Vector[(ActorRef[Message], ActorRef[Message])], inFlight: Int): Unit = {
|
||||||
for {
|
for {
|
||||||
(ping, pong) <- refs
|
(ping, pong) <- refs
|
||||||
val message = Message(pong) // just allocate once
|
message = Message(pong) // just allocate once
|
||||||
_ <- 1 to inFlight
|
_ <- 1 to inFlight
|
||||||
} {
|
} ping ! message
|
||||||
ping ! message
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private def startPingPongActorPairs(
|
private def startPingPongActorPairs(
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,8 @@ object AkkaDisciplinePlugin extends AutoPlugin with ScalafixSupport {
|
||||||
override def requires: Plugins = JvmPlugin && ScalafixPlugin
|
override def requires: Plugins = JvmPlugin && ScalafixPlugin
|
||||||
override lazy val projectSettings = disciplineSettings
|
override lazy val projectSettings = disciplineSettings
|
||||||
|
|
||||||
val nonFatalWarningsFor = Set(
|
// We allow warnings in docs to get the 'snippets' right
|
||||||
// We allow warnings in docs to get the 'snippets' right
|
val nonFatalWarningsFor = Set("akka-docs")
|
||||||
"akka-docs",
|
|
||||||
// To be reviewed
|
|
||||||
"akka-bench-jmh-typed")
|
|
||||||
|
|
||||||
val strictProjects = Set("akka-discovery", "akka-protobuf", "akka-coordination")
|
val strictProjects = Set("akka-discovery", "akka-protobuf", "akka-coordination")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue