-
Notifications
You must be signed in to change notification settings - Fork 73
/
cleanup_singlevalue
executable file
·26 lines (22 loc) · 1.11 KB
/
cleanup_singlevalue
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
#!/bin/bash
# Cleaning results from test number.
# Second parameter allows overriding the server name.
source ./config
source ./param
TEST=$1
RESULTPSQL="psql -h $RESULTHOST -U $RESULTUSER -p $RESULTPORT -d $RESULTDB"
if [ -n "$2" ] ; then
SERVERNAME=$2
echo Overriding server to ${SERVERNAME}
fi
pushd "results/${SERVERNAME}"
$RESULTPSQL -At -c "SELECT test FROM tests WHERE server='${SERVERNAME}' AND test=$TEST" | xargs rm -rf
$RESULTPSQL -c "DELETE FROM test_bgwriter WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM test_stat_database WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM test_statio WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM tests WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM test_metrics_data WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM test_settings WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM test_statements WHERE server='${SERVERNAME}' AND test=$TEST"
$RESULTPSQL -c "DELETE FROM test_buffercache WHERE server='${SERVERNAME}' AND test=$TEST"
popd