~ubuntuone-support/+junk/syncdaemon-perftest

« back to all changes in this revision

Viewing changes to syncdaemon-perftest-run.sh

  • Committer: Roman Yepishev
  • Date: 2012-02-29 11:45:32 UTC
  • Revision ID: roman.yepishev@canonical.com-20120229114532-29e8lgtykg2q54u9
Migrated to statsd, converting shell-based dropbox check to a python one

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
REALHOME=$HOME
15
15
 
 
16
export PYTHONPATH=$PWD/lib:.
 
17
 
16
18
RESET_U1_SCRIPT=/tmp/sdperftest-reset.u1
17
19
 
18
 
cat > $RESET_U1_SCRIPT <<EOF
19
 
login $oauth
20
 
cd "~/Ubuntu One"
21
 
delete a
22
 
EOF
 
20
TYPE=$1
 
21
 
 
22
[ -z "$TYPE" ] && TYPE="meta"
 
23
 
 
24
echo "Type: $TYPE"
23
25
 
24
26
for X in ${CONFIG[@]}; do
25
27
    shard_id=`echo $X | cut -d '/' -f 1`
26
28
    oauth=`echo $X | cut -d '/' -f 2`
27
29
 
28
30
    export HOME="/tmp/sdperftest-$shard_id"
29
 
    rm -rf $HOME $HOME.log $HOME.result
 
31
    rm -rf $HOME $HOME.result
30
32
    mkdir -p $HOME
31
33
 
32
34
    # Configure SD
43
45
 
44
46
    # Launch SD in new environment
45
47
    (
 
48
 
 
49
        cat > $RESET_U1_SCRIPT <<EOF
 
50
login $oauth
 
51
cd "~/Ubuntu One"
 
52
delete syncdaemon-perftest-tmp
 
53
EOF
 
54
 
46
55
        echo "$shard_id: Cleanup via REST API"
47
56
        $REALHOME/bin/ubuntuone-rest-files-client.py \
48
57
            -f $RESET_U1_SCRIPT >/dev/null 2>&1
51
60
        eval `dbus-launch`
52
61
        export DBUS_SESSION_BUS_ADDRESS
53
62
        echo "$shard_id: Started DBus daemon with PID $DBUS_SESSION_BUS_PID"
 
63
        OPTIONS=
 
64
 
 
65
        if [ "$TYPE" = "speed" ]; then
 
66
            OPTIONS="--file-count=1 --file-size=5242880 --track-speed"
 
67
        fi
 
68
        if [ "$TYPE" = "meta" ]; then
 
69
            OPTIONS="--file-count=200 --file-size=0 --track-queues"
 
70
        fi
54
71
 
55
72
        $REALHOME/bin/u1sdtool --start
56
73
        python syncdaemon-perftest.py \
57
74
            --log $HOME.log \
58
 
            --result $HOME.result \
59
75
            --graph-prefix="perf.$shard_id" \
60
 
            --file-count=200 \
61
 
            --file-size=512 \
 
76
            $OPTIONS \
62
77
            --timeout=$((8 * 60)) # 8 minutes
63
78
 
64
79
        kill $DBUS_SESSION_BUS_PID