Skip to content

Commit

Permalink
conf: benchmark启动脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnights committed Sep 12, 2016
1 parent 0a1b5c9 commit 936a63e
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ target/
.DS_Store
Thumbs.db
logs/
bin/
1 change: 1 addition & 0 deletions motan-benchmark/motan-benchmark-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
Expand Down
20 changes: 20 additions & 0 deletions motan-benchmark/motan-benchmark-client/src/main/bin/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
DIR=`pwd`
cd `dirname $0`
cd ../lib
LIB_DIR=`pwd`

SERVER_NAME='com.weibo.motan.benchmark.MotanBenchmarkClient'

PIDS=`ps -ef | grep java | grep "$LIB_DIR" | grep ${SERVER_NAME} | awk '{print $2}'`
if [ -n "$PIDS" ]; then
echo "start failed, the $SERVER_NAME already started!"
exit 1
fi

LIB_JARS=`ls ${LIB_DIR} | grep .jar | awk '{print "'${LIB_DIR}'/"$0}' | tr "\n" ":"`
cd ..
nohup java -classpath ${LIB_JARS} ${SERVER_NAME} nohup.client.out 2>&1 &

echo "start "${SERVER_NAME}" success!"
cd ${DIR}
21 changes: 21 additions & 0 deletions motan-benchmark/motan-benchmark-client/src/main/bin/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
DIR=`pwd`
cd `dirname $0`
cd ../lib
LIB_DIR=`pwd`

SERVER_NAME='com.weibo.motan.demo.client.DemoRpcClient'

PIDS=`ps -ef | grep java | grep "$LIB_DIR" | grep ${SERVER_NAME} | awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "stop failed, the $SERVER_NAME not start!"
exit 1
fi

for PID in ${PIDS};
do
kill ${PID} > /dev/null 2>&1
done

echo "stop success! pid:"${PIDS}
cd ${DIR}
1 change: 1 addition & 0 deletions motan-benchmark/motan-benchmark-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
Expand Down
20 changes: 20 additions & 0 deletions motan-benchmark/motan-benchmark-server/src/main/bin/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
DIR=`pwd`
cd `dirname $0`
cd ../lib
LIB_DIR=`pwd`

SERVER_NAME='com.weibo.motan.benchmark.MotanBenchmarkServer'

PIDS=`ps -ef | grep java | grep "$LIB_DIR" | grep ${SERVER_NAME} | awk '{print $2}'`
if [ -n "$PIDS" ]; then
echo "start failed, the $SERVER_NAME already started!"
exit 1
fi

LIB_JARS=`ls ${LIB_DIR} | grep .jar | awk '{print "'${LIB_DIR}'/"$0}' | tr "\n" ":"`
cd ..
nohup java -classpath ${LIB_JARS} ${SERVER_NAME} nohup.server.out 2>&1 &

echo "start "${SERVER_NAME}" success!"
cd ${DIR}
21 changes: 21 additions & 0 deletions motan-benchmark/motan-benchmark-server/src/main/bin/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
DIR=`pwd`
cd `dirname $0`
cd ../lib
LIB_DIR=`pwd`

SERVER_NAME='com.weibo.motan.benchmark.MotanBenchmarkServer'

PIDS=`ps -ef | grep java | grep "$LIB_DIR" | grep ${SERVER_NAME} | awk '{print $2}'`
if [ -z "$PIDS" ]; then
echo "stop failed, the $SERVER_NAME not start!"
exit 1
fi

for PID in ${PIDS};
do
kill ${PID} > /dev/null 2>&1
done

echo "stop success! pid:"${PIDS}
cd ${DIR}

0 comments on commit 936a63e

Please sign in to comment.