Materializer settings as attributes (#27499)
* Replace MaterializerSettings with Attributes #25559 * Field access to settings deprecated to make stages use attributes instead * Internal stages updated to use attributes * Docs on ActorMaterializerSettings updated to recommend away from using it * Verify all stages stopped after each testcase in FlowGroupBySpec * Subscription timeout attributes merged into one
This commit is contained in:
parent
b9a879d722
commit
aca63ea198
132 changed files with 1596 additions and 1116 deletions
|
|
@ -39,8 +39,6 @@ class MapAsyncBenchmark {
|
|||
implicit val system = ActorSystem("MapAsyncBenchmark", config)
|
||||
import system.dispatcher
|
||||
|
||||
var materializer: ActorMaterializer = _
|
||||
|
||||
var testSource: Source[java.lang.Integer, NotUsed] = _
|
||||
|
||||
@Param(Array("1", "4"))
|
||||
|
|
@ -51,9 +49,8 @@ class MapAsyncBenchmark {
|
|||
|
||||
@Setup
|
||||
def setup(): Unit = {
|
||||
val settings = ActorMaterializerSettings(system)
|
||||
materializer = ActorMaterializer(settings)
|
||||
|
||||
// eager init of materializer
|
||||
SystemMaterializer(system).materializer
|
||||
testSource = Source.fromGraph(new BenchTestSource(OperationsPerInvocation))
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +66,7 @@ class MapAsyncBenchmark {
|
|||
|
||||
testSource
|
||||
.mapAsync(parallelism)(elem => if (spawn) Future(elem) else Future.successful(elem))
|
||||
.runWith(new LatchSink(OperationsPerInvocation, latch))(materializer)
|
||||
.runWith(new LatchSink(OperationsPerInvocation, latch))
|
||||
|
||||
awaitLatch(latch)
|
||||
}
|
||||
|
|
@ -81,14 +78,14 @@ class MapAsyncBenchmark {
|
|||
|
||||
testSource
|
||||
.mapAsyncUnordered(parallelism)(elem => if (spawn) Future(elem) else Future.successful(elem))
|
||||
.runWith(new LatchSink(OperationsPerInvocation, latch))(materializer)
|
||||
.runWith(new LatchSink(OperationsPerInvocation, latch))
|
||||
|
||||
awaitLatch(latch)
|
||||
}
|
||||
|
||||
private def awaitLatch(latch: CountDownLatch): Unit = {
|
||||
if (!latch.await(30, TimeUnit.SECONDS)) {
|
||||
StreamTestKit.printDebugDump(materializer.supervisor)
|
||||
StreamTestKit.printDebugDump(ActorMaterializerHelper.downcast(SystemMaterializer(system).materializer).supervisor)
|
||||
throw new RuntimeException("Latch didn't complete in time")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue