From 6d255c46af6133e8ef9d435f932f3ceb5f6a6188 Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 11 Sep 2025 12:30:11 -0400 Subject: [PATCH 1/2] Remove pbench --- hammerdb/hammerdb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hammerdb/hammerdb b/hammerdb/hammerdb index 9596b65..2a1fd72 100755 --- a/hammerdb/hammerdb +++ b/hammerdb/hammerdb @@ -118,8 +118,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 @@ -276,12 +274,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 # @@ -313,7 +305,6 @@ 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 From 896931e8f0058df4675927d107455f265ccd23f3 Mon Sep 17 00:00:00 2001 From: David Valin Date: Fri, 12 Sep 2025 07:46:38 -0400 Subject: [PATCH 2/2] Add pcp support --- hammerdb/hammerdb | 14 +++++++++++--- hammerdb/run_hammerdb | 29 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/hammerdb/hammerdb b/hammerdb/hammerdb index 2a1fd72..2e911f8 100755 --- a/hammerdb/hammerdb +++ b/hammerdb/hammerdb @@ -20,6 +20,8 @@ arguments="$@" log_mount="" +pcp="" +pdir="" curdir=`pwd` if [[ $0 == "./"* ]]; then @@ -127,7 +129,7 @@ fi ${curdir}/test_tools/gather_data ${curdir} source test_tools/general_setup "$@" - +export TOOLS_BIN dnf -y install lvm2 @@ -286,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 @@ -310,7 +318,7 @@ 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 diff --git a/hammerdb/run_hammerdb b/hammerdb/run_hammerdb index 765943a..cc5073a 100755 --- a/hammerdb/run_hammerdb +++ b/hammerdb/run_hammerdb @@ -35,6 +35,8 @@ export Usercount test_to_run="none" dbhosts="none" version="1.0" +pcp=0 +pcpdir="" usage() { @@ -46,6 +48,7 @@ usage() echo " -H - default 127.0.0.1" echo " -d - default none" echo " -m - default none" + echo " -p - if pesent use pcp and what the dir is." echo " -T - Location to find the various test tools." echo " -t mariadb/postgres/mssql" echo " -u - default \"10 20 30 40 50\"" @@ -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} @@ -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" } @@ -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() @@ -442,6 +461,11 @@ do mountpoint=$2 shift 2 ;; + -p) + pcpdir=${2} + pcp=1 + shift 2 + ;; -w) whc=$2 shift 2 @@ -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