Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix finagle-chirper #136

Merged
merged 3 commits into from
May 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ class FinagleChirper extends RenaissanceBenchmark {
for (feed <- feeds) {
Await.ready(feed.close())
}
Await.ready(master.close())
}
}

Expand Down Expand Up @@ -349,6 +350,7 @@ class FinagleChirper extends RenaissanceBenchmark {
val batchSize = 4
var master: ListeningServer = null
var masterPort: Int = -1
var masterService: Service[Request, Response] = null
val clientCount = Runtime.getRuntime.availableProcessors
val cacheCount = Runtime.getRuntime.availableProcessors
val caches = new mutable.ArrayBuffer[ListeningServer]
Expand Down Expand Up @@ -417,20 +419,21 @@ class FinagleChirper extends RenaissanceBenchmark {
}
println("Master port: " + masterPort)
println("Cache ports: " + cachePorts.mkString(", "))
masterService = Http.newService(":" + masterPort)
}

override def tearDownAfterAll(c: Config): Unit = {
for (cache <- caches) {
Await.ready(cache.close())
}
Await.ready(master.close())
Await.ready(masterService.close())
}

override def beforeIteration(c: Config): Unit = {
val master = Http.newService(":" + masterPort)
val resetQuery = "/api/reset"
val request = Request(Method.Get, resetQuery)
require(Await.result(master.apply(request)).status == Status.Ok)
require(Await.result(masterService.apply(request)).status == Status.Ok)
}

override def runIteration(c: Config): Unit = {
Expand Down