envvars and better structure
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c05aabf185
commit
4d0920c40f
@ -19,22 +19,26 @@ fun Application.module(testing: Boolean = false) {
|
|||||||
val gson = GsonBuilder().setPrettyPrinting().create()
|
val gson = GsonBuilder().setPrettyPrinting().create()
|
||||||
val startTime = Instant.now()
|
val startTime = Instant.now()
|
||||||
var elapsed = Duration.ofSeconds(0)
|
var elapsed = Duration.ofSeconds(0)
|
||||||
val targetTime = Duration.ofSeconds(10)
|
val targetTime = Duration.ofSeconds(System.getenv("WAITTIME").toLong())
|
||||||
var currIter = 1
|
var currIter = 1
|
||||||
val timestamps = LinkedHashMap<Int,Instant>()
|
val timestamps = LinkedHashMap<Int,Instant>()
|
||||||
var currTimeStamp : Instant
|
var currTimeStamp : Instant
|
||||||
val uploader = Uploader()
|
val uploader = Uploader()
|
||||||
val processResults = ProcessResults()
|
val processResults = ProcessResults()
|
||||||
println("Starting benchmark")
|
environment.monitor.subscribe(ApplicationStarted) {
|
||||||
while(elapsed > targetTime){
|
println("Starting benchmark")
|
||||||
println(currIter)
|
val job = GlobalScope.launch {
|
||||||
uploader.uploadData(currIter, gson, cachedFile)
|
while(elapsed > targetTime){
|
||||||
currIter+=1
|
println(currIter)
|
||||||
currTimeStamp = Instant.now()
|
uploader.uploadData(currIter, gson, cachedFile)
|
||||||
timestamps[currIter] = currTimeStamp
|
currIter+=1
|
||||||
elapsed = Duration.between(startTime, currTimeStamp)
|
currTimeStamp = Instant.now()
|
||||||
|
timestamps[currIter] = currTimeStamp
|
||||||
|
elapsed = Duration.between(startTime, currTimeStamp)
|
||||||
|
}
|
||||||
|
println("Benchmark ended")
|
||||||
|
processResults.process()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
println("Benchmark ended")
|
|
||||||
processResults.process()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -34,7 +34,7 @@ class Uploader(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
client.submitFormWithBinaryData<Unit>(formData = parts) {
|
client.submitFormWithBinaryData<Unit>(formData = parts) {
|
||||||
url("https://birb.k8s.kmlabz.com/benchmark")
|
url(System.getenv("URL") ?: "https://birb.k8s.kmlabz.com/benchmark")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user