Skip to content

Commit

Permalink
Rapid reset bench (#2)
Browse files Browse the repository at this point in the history
* Update H2ClientServerBenchmark.scala

* don't throttle header frames

* only throttle reset frames

* rename params

* Update H2ClientServerBenchmark.scala

* Update Http2ServerDisableResetSpec.scala
  • Loading branch information
pjfanning authored Dec 18, 2023
1 parent 88a2c1e commit 8cac7d9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import pekko.http.scaladsl.settings.{ ClientConnectionSettings, ServerSettings }
import pekko.stream.TLSProtocol.{ SslTlsInbound, SslTlsOutbound }
import pekko.stream.scaladsl.{ BidiFlow, Flow, Keep, Sink, Source }
import pekko.util.ByteString
import com.typesafe.config.ConfigFactory
import org.openjdk.jmh.annotations._

import java.util.concurrent.{ CountDownLatch, TimeUnit }
Expand All @@ -40,6 +41,9 @@ class H2ClientServerBenchmark extends CommonBenchmark with H2RequestResponseBenc

val numRequests = 1000

@Param(Array("1s", "0s"))
var resetFrameThrottleInterval: String = _

@Benchmark
@OperationsPerInvocation(1000) // should be same as numRequest
def benchRequestProcessing(): Unit = {
Expand Down Expand Up @@ -69,7 +73,9 @@ class H2ClientServerBenchmark extends CommonBenchmark with H2RequestResponseBenc
def setup(): Unit = {
initRequestResponse()

system = ActorSystem("PekkoHttpBenchmarkSystem", config)
val resetFrameConfig = ConfigFactory.parseString(
s"pekko.http.server.http2.reset-frame.throttle-interval=$resetFrameThrottleInterval")
system = ActorSystem("PekkoHttpBenchmarkSystem", resetFrameConfig.withFallback(config))
val settings = implicitly[ServerSettings]
val log = system.log
implicit val ec = system.dispatcher
Expand Down

0 comments on commit 8cac7d9

Please sign in to comment.