Add yourKit profiler to perfTests

This commit is contained in:
Vladimir Dolzhenko
2020-04-30 22:26:27 +02:00
parent a564d47158
commit 7e55336300
4 changed files with 140 additions and 23 deletions
+21 -1
View File
@@ -67,7 +67,14 @@ javadocJar()
apply(from = "$rootDir/gradle/kotlinPluginPublication.gradle.kts")
projectTest(taskName = "performanceTest") {
classpath += files("${System.getenv("ASYNC_PROFILER_HOME")}/build/async-profiler.jar")
val currentOs = org.gradle.internal.os.OperatingSystem.current()
if (!currentOs.isWindows) {
System.getenv("ASYNC_PROFILER_HOME")?.let { asyncProfilerHome ->
classpath += files("$asyncProfilerHome/build/async-profiler.jar")
}
}
workingDir = rootDir
jvmArgs?.removeAll { it.startsWith("-Xmx") }
@@ -81,6 +88,19 @@ projectTest(taskName = "performanceTest") {
"-XX:+UseConcMarkSweepGC"
)
System.getenv("YOURKIT_PROFILER_HOME")?.let {yourKitHome ->
when {
currentOs.isLinux -> {
jvmArgs("-agentpath:$yourKitHome/bin/linux-x86-64/libyjpagent.so")
classpath += files("$yourKitHome/lib/yjp-controller-api-redist.jar")
}
currentOs.isMacOsX -> {
jvmArgs("-agentpath:$yourKitHome/Contents/Resources/bin/mac/libyjpagent.dylib")
classpath += files("$yourKitHome/Contents/Resources/lib/yjp-controller-api-redist.jar")
}
}
}
doFirst {
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
project.findProperty("cacheRedirectorEnabled")?.let {