File: gen-startup-data.sh

package info (click to toggle)
software-center 5.1.2debian3.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 8,708 kB
  • sloc: python: 28,999; xml: 379; sh: 127; makefile: 28
file content (35 lines) | stat: -rwxr-xr-x 898 bytes parent folder | download
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
#/bin/sh

LOGFILE=startup-times.dat
BASE_BZR=lp:software-center
FIRST_BZR_REV=1277
LAST_BZR_REV=$(bzr revno $BASE_BZR)

if [ ! -e "$LOGFILE" ]; then 
    echo "# statup time log" > $LOGFILE
    echo "#revno    startup-time" >> $LOGFILE
fi

i=$LAST_BZR_REV
while [ $i -gt $FIRST_BZR_REV ]; do
    # stop if we have a copy of this already, it means we
    # have tested that dir already
    if [ -d rev-$i ]; then
        break
    fi
    # test the new revision
    bzr get -r $i $BASE_BZR rev-$i
    cd rev-$i
    # first run is to warm up the cache and rebuild the DB (if needed)
    PYTHONPATH=. ./software-center --measure-startup-time
    # 3 runs with the given revision
    for testrun in 1 2 3 4 5; do
        echo -n "$i   " >> ../$LOGFILE
        PYTHONPATH=. ./software-center --measure-startup-time >> ../$LOGFILE
    done
    cd ..
    i=$((i-1))
done

# plot it
./plot-startup-data.py