Ah, yes. You know, I knew that, my brain managed to forget that it knew it for 
the past hour though.

Thanks for the prompt.

For the thread, if you run multiple jmeter instances on one machine it looks 
like the port is assigned dynamically so you have to parse stdout from jmeter 
and use the returned port in the shutdown command.

Parsing stdout:
jmeter.stdout.on('data', function (data) {
        if(data.indexOf('Waiting for possible')>-1){
                var match = data.match(/\d+/);
                jmeter.port=parseInt(match[0], 10);
        }
});

Sending shutdown command with port specified:
var shutdownCmd='/Applications/apache-jmeter-2.7/bin/shutdown.sh '+jmeter.port;
terminator = childProcess.exec(shutdownCmd, function (error, stdout, stderr) {
        if (error) {
                console.log(error.stack);
                console.log('Error code: '+error.code);
                console.log('Signal received: '+error.signal);
        }
});


On 7 Jul 2012, at 17:23, Philippe Mouawad wrote:

> Hello Oliver,
> 
> These commands can be sent by using theshutdown[.cmd|.sh] or
> stoptest[.cmd|.sh]script respectively. The scripts are to be found in the
> JMeter bin directory. The commands will only be accepted if the script is
> run from the same host.
> 
> From:
> http://jmeter.apache.org/usermanual/build-test-plan.html
> 
> Regards
> Philippe
> On Saturday, July 7, 2012, Oliver Lloyd wrote:
> 
>> So aparently Jmeter waits for a possible shutdown message on port 4445.
>> Can anyone tell me what it is and how to send this command?
>> 
>> I'm running JMeter by spawning a child process from node which gives me
>> the pid for the actual jmeter command just fine, but not the JVM. So I can
>> send SIGTERM to jmeter but this isn't killing the actual test. The
>> workaround here would be to grep ps -ef and pull out the java pid from
>> there and send kill -15 to that, but to be honest that idea fills me with
>> dread.
>> 
>> Alternatively, is there any way to interrogate jmeter to get the pid for
>> the java process that it triggered?
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected] <javascript:;>
>> For additional commands, e-mail: [email protected]<javascript:;>
>> 
>> 
> 
> -- 
> Cordialement.
> Philippe Mouawad.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to