From 029cc1c2f0399d4e4742540254da816b55381fe2 Mon Sep 17 00:00:00 2001 From: "rick.parker" Date: Thu, 2 Nov 2017 14:58:47 +0000 Subject: [PATCH] Some clean up. Remote slave via capsule is working. --- .../src/main/kotlin/net/corda/jmeter/Launcher.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/jmeter/src/main/kotlin/net/corda/jmeter/Launcher.kt b/tools/jmeter/src/main/kotlin/net/corda/jmeter/Launcher.kt index 47787db764..f06ce17a86 100644 --- a/tools/jmeter/src/main/kotlin/net/corda/jmeter/Launcher.kt +++ b/tools/jmeter/src/main/kotlin/net/corda/jmeter/Launcher.kt @@ -1,13 +1,23 @@ package net.corda.jmeter import org.apache.jmeter.JMeter +import org.slf4j.LoggerFactory class Launcher { companion object { @JvmStatic fun main(args: Array) { + val logger = LoggerFactory.getLogger(this::class.java) val jmeter = JMeter() - jmeter.start(args) + val capsuleDir = System.getProperty("capsule.dir") + if (capsuleDir != null) { + // We are running under Capsule, so assume we want a JMeter distributed server to be controlled from + // elsewhere. + logger.info("Starting JMeter in server mode from $capsuleDir") + jmeter.start(arrayOf("-s", "-d", capsuleDir, "-p", "$capsuleDir/jmeter.properties") + args) + } else { + jmeter.start(args) + } } } } \ No newline at end of file