From 8141f909eb883c0bb348c4bc209066bae77a2297 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 27 Nov 2025 17:42:17 +0100 Subject: [PATCH] Add ProfilerCommand.kt --- src/main/kotlin/commands/profiler/ProfilerCommand.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/commands/profiler/ProfilerCommand.kt b/src/main/kotlin/commands/profiler/ProfilerCommand.kt index 4b098dd..d2a26f9 100644 --- a/src/main/kotlin/commands/profiler/ProfilerCommand.kt +++ b/src/main/kotlin/commands/profiler/ProfilerCommand.kt @@ -9,6 +9,8 @@ import com.github.ajalt.clikt.parameters.options.default import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.int +const val SPARK = "/jars/spark.jar" + class ProfilerCommand: CliktCommand("profiler") { val pid by argument().help("Process id").int().optional() val port by option("--port", "-p").int().default(8543) @@ -16,7 +18,7 @@ class ProfilerCommand: CliktCommand("profiler") { override fun run() { if (pid != null) { ProcessBuilder() - .command("java", "-jar", "/jars/spark.java", pid.toString(), "port=$port") + .command("java", "-jar", SPARK, pid.toString(), "port=$port") .start() .waitFor() @@ -27,7 +29,7 @@ class ProfilerCommand: CliktCommand("profiler") { .waitFor() } else { ProcessBuilder() - .command("java", "-jar", "/jars/spark.java") + .command("java", "-jar", SPARK) .inheritIO() .start() .waitFor()