Created
February 14, 2018 10:24
-
-
Save HeartSaVioR/27300c7e476efb4b58e86656e2073505 to your computer and use it in GitHub Desktop.
TVL 2.0.0 test runner (for 1 worker)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
current_test=1 | |
test_count=3 | |
storm_directory="`pwd`" | |
part1=`dirname "${storm_directory}"` | |
part2=`basename "${storm_directory}"` | |
storm_test_version=`basename "${part1}"` | |
echo "test version: ${storm_test_version}" | |
storm_command_path="./bin/storm" | |
storm_starter_jar_path="examples/storm-loadgen/target/storm-loadgen-*.jar" | |
test_class="org.apache.storm.loadgen.ThroughputVsLatency" | |
rate="85000" | |
spouts=1 | |
splitters=1 | |
counters=1 | |
workers=1 | |
max_spout_pending="5000" | |
args="--rate ${rate} --spouts ${spouts} --splitters ${splitters} --counters ${counters} " | |
configs="-c topology.max.spout.pending=${max_spout_pending} -c topology.workers=${workers}" | |
log_file_path_prefix="/home/heartsavior/original-perf-test-TVL-workers-${workers}-rate-${rate}-spouts-${spouts}-splitters-${splitters}-counters-${counters}-maxspoutpending-${max_spout_pending}-${storm_test_version}-v" | |
log_file_path_postfix=".log" | |
# wait for idle of cpu before start | |
cpu_usage=`vmstat 1 | head -n 5 | tail -n 1 | grep -v procs | grep -v swpd | awk '{ print $13 + $14 }'` | |
while [ ${cpu_usage} -gt 10 ]; do | |
echo "CPU usage (${cpu_usage}) is still high... sleep more..." | |
sleep 10 | |
cpu_usage=`vmstat 1 | head -n 5 | tail -n 1 | grep -v procs | grep -v swpd | awk '{ print $13 + $14 }'` | |
done | |
while [ $test_count -ge $current_test ]; do | |
output_path=${log_file_path_prefix}${current_test}${log_file_path_postfix} | |
echo "Running test, ${current_test} th trial... output will be stored to ${output_path}" | |
echo "command: ${storm_command_path} jar ${storm_starter_jar_path} ${test_class} ${args} ${configs} 1>${output_path} 2>&1" | |
${storm_command_path} jar ${storm_starter_jar_path} ${test_class} ${args} ${configs} 1>${output_path} 2>&1 | |
sleep 30 | |
# sleep until user + sys is greater than 10 | |
cpu_usage=`vmstat 1 | head -n 5 | tail -n 1 | grep -v procs | grep -v swpd | awk '{ print $13 + $14 }'` | |
while [ ${cpu_usage} -gt 10 ]; do | |
echo "CPU usage (${cpu_usage}) is still high... sleep more..." | |
sleep 10 | |
cpu_usage=`vmstat 1 | head -n 5 | tail -n 1 | grep -v procs | grep -v swpd | awk '{ print $13 + $14 }'` | |
done | |
let current_test=current_test+1 | |
done | |
echo "Complete!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment