Skip to content

Commit 812a75e

Browse files
author
Can Gokmen
committed
Updated tpcc script
1 parent 0dbaaec commit 812a75e

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tpcc/run_tpcc.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Run the TPC-C insert experiment for both ART and QuART_stail_reset_2
33
# and write results to tpcc/results_tpcc_<timestamp>.csv
44
#
5-
# Usage: bash tpcc/run_tpcc.sh [num_transactions] [repeats]
5+
# Usage: bash tpcc/run_tpcc.sh [num_transactions] [repeats] [batch_size]
66

77
set -euo pipefail
88

@@ -15,7 +15,9 @@ N=${1:-500000} # number of NewOrder transactions (~5M keys on average)
1515
REPEATS=${2:-5} # repeats per tree
1616

1717
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
18-
OUTFILE="$SCRIPT_DIR/results_tpcc_${TIMESTAMP}.csv"
18+
RESULTS_DIR="$SCRIPT_DIR/results"
19+
mkdir -p "$RESULTS_DIR"
20+
OUTFILE="$RESULTS_DIR/results_tpcc_${TIMESTAMP}.csv"
1921

2022
# Build if binary missing or sources newer
2123
if [[ ! -f "$BINARY" ]] || \
@@ -27,14 +29,12 @@ fi
2729

2830
echo "tree_type,workload,num_keys,avg_insert_ns,avg_insert_ns_per_key" > "$OUTFILE"
2931

30-
for WORKLOAD in "random" "batch" "sequential"; do
31-
WFLAG="-w $WORKLOAD"
32-
[[ "$WORKLOAD" == "batch" ]] && WFLAG="-w batch -B 100"
33-
for TREE in ART QuART_stail_reset_2; do
34-
echo "Running $TREE workload=$WORKLOAD (N=$N transactions, $REPEATS repeats)..."
35-
"$BINARY" -N "$N" -t "$TREE" -r "$REPEATS" -v $WFLAG 2>&1 1>/dev/null | cat
36-
"$BINARY" -N "$N" -t "$TREE" -r "$REPEATS" $WFLAG | tee -a "$OUTFILE"
37-
done
32+
B=${3:-100} # batch size, default 100
33+
34+
for TREE in ART QuART_stail_reset_2; do
35+
echo "Running $TREE workload=batch(${B}) (N=$N transactions, $REPEATS repeats)..."
36+
"$BINARY" -N "$N" -t "$TREE" -r "$REPEATS" -v -w batch -B "$B" 2>&1 1>/dev/null | cat
37+
"$BINARY" -N "$N" -t "$TREE" -r "$REPEATS" -w batch -B "$B" | tee -a "$OUTFILE"
3838
done
3939

4040
echo ""

0 commit comments

Comments
 (0)