forked from PASAUCMerced/PMDebugger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredis_brief_run.sh
47 lines (43 loc) · 1.53 KB
/
redis_brief_run.sh
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
#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
if [[ $1 == 'pmdebugger' ]]
then
rm /mnt/dbpmemfs/redis.pm
valgrind --tool=pmdebugger ./src/redis-server redis.conf &> /dev/null &
sleep 50
echo "throughput (Get/Sec)"
timeout 20s stdbuf -o0 src/redis-cli --lru-test $2 |& grep "Gets/sec" | awk '{sum+=$1;num++} END{print sum/num;}'
echo "shutdown" | src/redis-cli &> /dev/null
elif [[ $1 == 'pmemcheck' ]]
then
rm /mnt/dbpmemfs/redis.pm
valgrind --tool=pmemcheck ./src/redis-server redis.conf &> /dev/null &
#./src/redis-server redis.conf &
sleep 50
echo "throughput (Get/Sec)"
timeout 20s stdbuf -o0 src/redis-cli --lru-test $2 |& grep "Gets/sec" | awk '{sum+=$1;num++} END{print sum/num;}'
echo "shutdown" | src/redis-cli &> /dev/null
rm /mnt/dbpmemfs/redis.pm
elif [[ $1 == 'Nulgrind' ]]
then
rm /mnt/dbpmemfs/redis.pm
valgrind --tool=none ./src/redis-server redis.conf &> /dev/null &
#./src/redis-server redis.conf &
sleep 50
echo "throughput (Get/Sec)"
timeout 20s stdbuf -o0 src/redis-cli --lru-test $2 |& grep "Gets/sec" | awk '{sum+=$1;num++} END{print sum/num;}'
echo "shutdown" | src/redis-cli &> /dev/null
rm /mnt/dbpmemfs/redis.pm
elif [[ $1 == 'original' ]]
then
rm /mnt/dbpmemfs/redis.pm
./src/redis-server redis.conf &> /dev/null &
#./src/redis-server redis.conf &
sleep 50
echo "throughput (Get/Sec)"
timeout 20s stdbuf -o0 src/redis-cli --lru-test $2 |& grep "Gets/sec" | awk '{sum+=$1;num++} END{print sum/num;}'
echo "shutdown" | src/redis-cli &> /dev/null
rm /mnt/dbpmemfs/redis.pm
else
echo "Unknow checker"
fi