improved benchmark accuracy
This commit is contained in:
@@ -81,6 +81,8 @@ class BenchmarkCommand : GbcsCommand() {
|
|||||||
semaphore.release()
|
semaphore.release()
|
||||||
completionCounter.incrementAndGet()
|
completionCounter.incrementAndGet()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Thread.sleep(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,9 +105,10 @@ class BenchmarkCommand : GbcsCommand() {
|
|||||||
val completionCounter = AtomicLong(0)
|
val completionCounter = AtomicLong(0)
|
||||||
val semaphore = Semaphore(profile.maxConnections * 3)
|
val semaphore = Semaphore(profile.maxConnections * 3)
|
||||||
val start = Instant.now()
|
val start = Instant.now()
|
||||||
entries.forEach { entry ->
|
val it = entries.iterator()
|
||||||
semaphore.acquire()
|
while (completionCounter.get() < entries.size) {
|
||||||
|
if (it.hasNext()) {
|
||||||
|
val entry = it.next()
|
||||||
val future = client.get(entry.first).thenApply {
|
val future = client.get(entry.first).thenApply {
|
||||||
if (it == null) {
|
if (it == null) {
|
||||||
log.error {
|
log.error {
|
||||||
@@ -121,6 +124,9 @@ class BenchmarkCommand : GbcsCommand() {
|
|||||||
completionCounter.incrementAndGet()
|
completionCounter.incrementAndGet()
|
||||||
semaphore.release()
|
semaphore.release()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Thread.sleep(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val end = Instant.now()
|
val end = Instant.now()
|
||||||
log.info {
|
log.info {
|
||||||
|
Reference in New Issue
Block a user