From e283dccd060bd4163b649a27ebca8fed893bb19a Mon Sep 17 00:00:00 2001 From: humkum <50660789+humkum@users.noreply.github.com> Date: Tue, 22 Mar 2022 09:39:36 +0800 Subject: [PATCH] add shutdown script for batchproducer.sh (#4015) Co-authored-by: hankunming --- distribution/benchmark/shutdown.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/distribution/benchmark/shutdown.sh b/distribution/benchmark/shutdown.sh index 9ecd32600e..2af7ef741d 100644 --- a/distribution/benchmark/shutdown.sh +++ b/distribution/benchmark/shutdown.sh @@ -24,7 +24,7 @@ case $1 in exit -1; fi - echo "The benchmkar producer(${pid}) is running..." + echo "The benchmark producer(${pid}) is running..." kill ${pid} @@ -52,12 +52,26 @@ case $1 in exit -1; fi - echo "The benchmkar transaction producer(${pid}) is running..." + echo "The benchmark transaction producer(${pid}) is running..." kill ${pid} echo "Send shutdown request to benchmark transaction producer(${pid}) OK" ;; + bproducer) + + pid=`ps ax | grep -i 'org.apache.rocketmq.example.benchmark.BatchProducer' |grep java | grep -v grep | awk '{print $1}'` + if [ -z "$pid" ] ; then + echo "No benchmark batch producer running." + exit -1; + fi + + echo "The benchmark batch producer(${pid}) is running..." + + kill ${pid} + + echo "Send shutdown request to benchmark batch producer(${pid}) OK" + ;; *) - echo "Useage: shutdown producer | consumer | tproducer" + echo "Usage: shutdown producer | consumer | tproducer | bproducer" esac