Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions hammerdb/hammerdb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

arguments="$@"
log_mount=""
pcp=""
pdir=""

curdir=`pwd`
if [[ $0 == "./"* ]]; then
Expand Down Expand Up @@ -118,8 +120,6 @@ fi
# to_home_root: home directory
# to_configuration: configuration information
# to_times_to_run: number of times to run the test
# to_pbench: Run the test via pbench
# to_puser: User running pbench
# to_run_label: Label for the run
# to_user: User on the test system running the test
# to_sys_type: for results info, basically aws, azure or local
Expand All @@ -129,7 +129,7 @@ fi

${curdir}/test_tools/gather_data ${curdir}
source test_tools/general_setup "$@"

export TOOLS_BIN

dnf -y install lvm2

Expand Down Expand Up @@ -276,12 +276,6 @@ if [[ $test == "none" ]]; then
usage $0
fi

if [ $to_pbench -eq 1 ]; then
echo $TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats
$TOOLS_BIN/execute_via_pbench --cmd_executing "$0" $arguments --test ${test_name}_${test} --spacing 11 --pbench_stats $to_pstats
exit
fi

create_and_mount_fs

#
Expand All @@ -294,8 +288,14 @@ fi
pushd /usr/local > /dev/null
rm -rf $test
popd > /dev/null
cpdir=""
if [[ $to_use_pcp -eq 1 ]]; then
pdir=/tmp/pcp_`date "+%Y.%m.%d-%H.%M.%S"`
pcp="-p ${pdir}"
cpdir="--copy_dir $pdir"
fi
cd $exec_dir
echo ./run_hammerdb -m /perf1 -t ${test} ${users_to_run} ${warehouses} ${log_mount} -T ${TOOLS_BIN} > run_this
echo ./run_hammerdb -m /perf1 -t ${test} ${users_to_run} ${warehouses} ${log_mount} -T ${TOOLS_BIN} $pcp > run_this
chmod 755 run_this
./run_this

Expand All @@ -313,13 +313,12 @@ fi

cp /tmp/hammerdb.out .
popd
rm -f results_pbench.tar

tmp_file=`mktemp /tmp/hammer_data.XXXXX`
find -L $test -type f -exec grep -Iq . {} \; -print > $tmp_file
#echo "/usr/local/${test}/results_hammerdb_*.csv" >> $tmp_file
egrep "out|csv|report" $tmp_file | egrep -v "Hammerdb" | grep -v tcl | tar cf /tmp/results_hammerdb_${test}_${to_tuned_setting}.tar --files-from=/dev/stdin
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --tar_file /tmp/results_hammerdb_${test}_${to_tuned_setting}.tar --test_name hammerdb_$test_name_${test} --tuned_setting=$to_tuned_setting --version "None" --user $to_user
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --tar_file /tmp/results_hammerdb_${test}_${to_tuned_setting}.tar --test_name hammerdb_$test_name_${test} --tuned_setting=$to_tuned_setting --version "None" --user $to_user $cpdir
rm $tmp_file

if [[ $to_tuned_setting != "none" ]]; then
Expand Down
29 changes: 29 additions & 0 deletions hammerdb/run_hammerdb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export Usercount
test_to_run="none"
dbhosts="none"
version="1.0"
pcp=0
pcpdir=""

usage()
{
Expand All @@ -46,6 +48,7 @@ usage()
echo " -H <Host names separated by space> - default 127.0.0.1"
echo " -d <device > - default none"
echo " -m <mount points> - default none"
echo " -p <dir> - if pesent use pcp and what the dir is."
echo " -T <tools dir> - Location to find the various test tools."
echo " -t <test to run> mariadb/postgres/mssql"
echo " -u <user count> - default \"10 20 30 40 50\""
Expand Down Expand Up @@ -134,6 +137,9 @@ run_hammerdb_users()
# that operates on remote systems, the other that operate on the system we are currently
# running on.
export uc
if [[ $pcp -eq 1 ]]; then
start_pcp_subset
fi
if [[ $dbhosts != "none" ]]; then
export ctr=1
for hostnm in ${dbhosts}
Expand Down Expand Up @@ -217,6 +223,12 @@ run_hammerdb_users()
ctr=$((ctr + 1))
export ctr
fi
if [[ $pcp -eq 1 ]]; then
echo "Send result to PCP archive"
out="${uc}"
result2pcp user_count_${uc} ${out}
stop_pcp_subset
fi
echo "${uc} User run done"
}

Expand Down Expand Up @@ -267,10 +279,17 @@ shut_down()
#
run_hammerdb()
{
if [[ $pcp -eq 1 ]]; then
echo "Start PCP"
start_pcp ${pcpdir}/ hammerdb_${test_to_run} $pcp_cfg
fi
for uc in ${Usercount}
do
run_hammerdb_users $uc
done
if [[ $pcp -eq 1 ]]; then
shutdown_pcp
fi
}

mariadb_install()
Expand Down Expand Up @@ -442,6 +461,11 @@ do
mountpoint=$2
shift 2
;;
-p)
pcpdir=${2}
pcp=1
shift 2
;;
-w)
whc=$2
shift 2
Expand Down Expand Up @@ -477,6 +501,11 @@ mount_check
#
# Determine what we are to run and run it.
#
if [[ $pcp -eq 1 ]]; then
source $TOOLS_BIN/pcp/pcp_commands.inc
setup_pcp
pcp_cfg=$TOOLS_BIN/pcp/default.cfg
fi
if [[ $test_to_run == "mariadb" ]]; then
if [[ $whc == "" ]]; then
whc=1000
Expand Down
Loading