oops
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Torma Kristóf 2020-10-22 19:35:01 +02:00
parent a212aa300c
commit f3d339a4a6
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
1 changed files with 6 additions and 8 deletions

View File

@ -1,10 +1,8 @@
package com.kmlabz.k8s
import com.google.gson.GsonBuilder
import io.ktor.application.*
import io.ktor.util.*
import kotlinx.coroutines.*
import java.io.File
import java.time.Duration
import java.time.Instant
@ -18,7 +16,7 @@ fun Application.module(testing: Boolean = false) {
var startTime: Instant
var elapsed = Duration.ofSeconds(0)
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
var currIter = 1
var currIter = 0
val timestamps = LinkedHashMap<Int, Instant>()
var currTimeStamp: Instant
val uploader = Uploader()
@ -27,17 +25,17 @@ fun Application.module(testing: Boolean = false) {
println("Starting benchmark")
startTime = Instant.now()
while (elapsed < targetTime) {
val job = GlobalScope.launch {
currIter += 1
GlobalScope.launch {
uploader.uploadData(currIter)
currIter += 1
currTimeStamp = Instant.now()
timestamps[currIter] = currTimeStamp
elapsed = Duration.between(startTime, currTimeStamp)
}
println("Benchmark ended")
processResults.mapToProcess = timestamps
processResults.process()
}
println("Benchmark ended")
processResults.mapToProcess = timestamps
processResults.process()
}
}
}