-
Notifications
You must be signed in to change notification settings - Fork 61
/
run.simple.bash
executable file
·98 lines (76 loc) · 4.22 KB
/
run.simple.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# enable passing different config files
if [ ! $1 ];
then
FILE="config.bash"
else
FILE=$1
fi
if [ -f $FILE ];
then
echo "Loading config from $FILE....."
source $FILE
else
echo "Unable to read config $FILE"
exit 1
fi
if [ $2 ];
then
echo "Loading config overrides from $2....."
source $2
fi
CLASSPATH="mongo-java-driver-3.9.1.jar:mongodb-driver-core-3.9.1.jar:mongodb-driver-legacy-3.9.1.jar:$CLASSPATH"
TAIL_LINES=21
javac -cp $CLASSPATH:$PWD/src src/jmongosysbenchload.java
javac -cp $CLASSPATH:$PWD/src src/jmongosysbenchexecute.java
javac -cp $CLASSPATH:$PWD/src src/jmongosysbenchshardedload.java
javac -cp $CLASSPATH:$PWD/src src/jmongosysbenchshardedexecute.java
# load the data
if [[ $DOLOAD = "yes" ]]; then
echo Do load at $( date )
export LOG_NAME=mongoSysbenchLoad-${DOCDB_DBNAME}-${NUM_COLLECTIONS}-${NUM_DOCUMENTS_PER_COLLECTION}-${NUM_LOADER_THREADS}.txt
export BENCHMARK_TSV=${LOG_NAME}.tsv
rm -f $LOG_NAME
rm -f $BENCHMARK_TSV
T="$(date +%s)"
if [[ $SHARDED = "no" ]]; then
echo "executing standard sysbench load (not sharded)" | tee -a $LOG_NAME
java -cp $CLASSPATH:$PWD/src jmongosysbenchload $NUM_COLLECTIONS $DB_NAME $NUM_LOADER_THREADS $NUM_DOCUMENTS_PER_COLLECTION $NUM_DOCUMENTS_PER_INSERT $NUM_INSERTS_PER_FEEDBACK $NUM_SECONDS_PER_FEEDBACK $BENCHMARK_TSV "$TRUST_STORE" "$TRUST_STORE_PASSWORD" $URI
else
echo "executing sharded sysbench load" | tee -a $LOG_NAME
java -cp $CLASSPATH:$PWD/src jmongosysbenchshardedload $NUM_COLLECTIONS $DB_NAME $NUM_LOADER_THREADS $NUM_DOCUMENTS_PER_COLLECTION $NUM_DOCUMENTS_PER_INSERT $NUM_INSERTS_PER_FEEDBACK $NUM_SECONDS_PER_FEEDBACK $BENCHMARK_TSV "$TRUST_STORE" "$TRUST_STORE_PASSWORD" $MAX_SHARD_KEY $DOCS_PER_SHARD $URI
fi
echo "" | tee -a $LOG_NAME
T="$(($(date +%s)-T))"
printf "`date` | sysbench loader duration = %02d:%02d:%02d:%02d\n" "$((T/86400))" "$((T/3600%24))" "$((T/60%60))" "$((T%60))" | tee -a $LOG_NAME
echo ""
echo "************************************************************************"
echo "final ${numTailLines} interval(s)"
echo "************************************************************************"
tail -n $TAIL_LINES $LOG_NAME
fi
# execute the benchmark
if [[ $DOQUERY = "yes" ]]; then
echo Do query at $( date )
export LOG_NAME=mongoSysbenchExecute-${DOCDB_DBNAME}-${NUM_COLLECTIONS}-${NUM_DOCUMENTS_PER_COLLECTION}-${NUM_WRITER_THREADS}.txt
export BENCHMARK_TSV=${LOG_NAME}.tsv
rm -f $LOG_NAME
rm -f $BENCHMARK_TSV
T="$(date +%s)"
if [[ $SHARDED = "no" ]]; then
echo "executing standard sysbench" | tee -a $LOG_NAME
java -cp $CLASSPATH:$PWD/src jmongosysbenchexecute $NUM_COLLECTIONS $DB_NAME $NUM_WRITER_THREADS $NUM_DOCUMENTS_PER_COLLECTION $NUM_SECONDS_PER_FEEDBACK $BENCHMARK_TSV $RUN_TIME_SECONDS $SYSBENCH_RANGE_SIZE $SYSBENCH_POINT_SELECTS $SYSBENCH_SIMPLE_RANGES $SYSBENCH_SUM_RANGES $SYSBENCH_ORDER_RANGES $SYSBENCH_DISTINCT_RANGES $SYSBENCH_INDEX_UPDATES $SYSBENCH_NON_INDEX_UPDATES $SYSBENCH_INSERTS $MAX_TPS $SEED "$TRUST_STORE" "$TRUST_STORE_PASSWORD" "$URI" | tee -a $LOG_NAME
else
echo "executing standard sysbench" | tee -a $LOG_NAME
java -cp $CLASSPATH:$PWD/src jmongosysbenchshardedexecute $NUM_COLLECTIONS $DB_NAME $NUM_WRITER_THREADS $NUM_DOCUMENTS_PER_COLLECTION $NUM_SECONDS_PER_FEEDBACK $BENCHMARK_TSV $RUN_TIME_SECONDS $SYSBENCH_RANGE_SIZE $SYSBENCH_POINT_SELECTS $SYSBENCH_SIMPLE_RANGES $SYSBENCH_SUM_RANGES $SYSBENCH_ORDER_RANGES $SYSBENCH_DISTINCT_RANGES $SYSBENCH_INDEX_UPDATES $SYSBENCH_NON_INDEX_UPDATES $SYSBENCH_INSERTS $MAX_TPS $SEED "$TRUST_STORE" "$TRUST_STORE_PASSWORD" $MAX_SHARD_KEY $DOCS_PER_SHARD "$URI" | tee -a $LOG_NAME
fi
echo "" | tee -a $LOG_NAME
T="$(($(date +%s)-T))"
printf "`date` | sysbench benchmark duration = %02d:%02d:%02d:%02d\n" "$((T/86400))" "$((T/3600%24))" "$((T/60%60))" "$((T%60))" | tee -a $LOG_NAME
echo ""
echo "************************************************************************"
echo "final ${numTailLines} interval(s)"
echo "************************************************************************"
tail -n $TAIL_LINES $LOG_NAME
#cat $LOG_NAME | grep '170 seconds' >> results.txt
fi