~ubuntuone-support/+junk/syncdaemon-perftest

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
#!/bin/bash

cd `dirname $0`

export PATH=$PWD/bin:$PATH
export PYTHONPATH=$PWD/lib:.

# If the configuration is not there, we will do nothing
CONFIG=syncdaemon-perftest.conf

if [ ! -f $CONFIG ]; then
    exit 0
fi

source $CONFIG

dropbox stop

TYPE=$1

[ -z "$TYPE" ] && TYPE="meta"

OPTIONS=

case $TYPE in
    "speed")
        OPTIONS="--file-count=1 --file-size=5242880 --track-speed"
        ;;
    "meta")
        OPTIONS="--file-count=200 --file-size=0 --track-queues"
        ;;
    "mixed")
        OPTIONS="--file-count=200 --file-size=..1048576 "
        OPTIONS="$OPTIONS --track-speed --track-queues"
        ;;
esac

python dropbox-perftest.py \
    --log /tmp/dropbox-perftest.log \
    --graph-prefix="$STATSD_PREFIX.dropbox" \
    $OPTIONS \
    --statsd $STATSD_HOST:$STATSD_PORT \
    --timeout=$((8 * 60))