benchmark: keep JMH results

This commit is contained in:
Daniel Langbein 2025-01-31 16:25:34 +01:00
parent f5c10d77c2
commit ac7d8608f2
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -3,6 +3,9 @@
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation.
*/
import java.util.Date
import java.text.SimpleDateFormat
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
application
@ -84,6 +87,10 @@ tasks {
}
}
fun buildTime(): String {
return SimpleDateFormat("yyyyMMddHHmm").format(Date())
}
// https://github.com/melix/jmh-gradle-plugin/blob/master/README.adoc#configuration-options
jmh {
// Use latest JMH version (1.37, https://github.com/openjdk/jmh/tags)
@ -97,9 +104,9 @@ jmh {
forceGC = true
// If human output is saved, it won't be written to stdout while running the benchmark!
humanOutputFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/human.txt")
humanOutputFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/${buildTime()}/human.txt")
resultsFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/results.csv")
resultsFile = project.file("${project.layout.buildDirectory.get()}/reports/jmh/${buildTime()}/results.csv")
resultFormat = "CSV"
excludes = listOf(