PageRenderTime 102ms CodeModel.GetById 57ms app.highlight 3ms RepoModel.GetById 27ms app.codeStats 0ms

/utils/benchmark

http://github.com/AF83/ucengine
#! | 46 lines | 35 code | 11 blank | 0 comment | 0 complexity | a9214e0f5a88e751212eb912714a1228 MD5 | raw file
 1#!/bin/bash
 2
 3TSUNG_PATH=$(which tsung)
 4
 5if [ -z $TSUNG_PATH ];
 6then
 7    echo "You must install tsung or put it in you PATH."
 8    exit 1
 9fi
10
11TSUNG_SHARE_PATH=$(dirname $TSUNG_PATH)"/.."
12
13if [ -z $1 ];
14then
15    echo "Please provide a scenario name"
16    exit 1
17fi
18
19if [ -z $2 ];
20then
21    echo "Please provide a level name (soft, normal or hard)"
22    exit 2
23fi
24
25SCENARII_FILE=benchmarks/scenarii/$1.yml
26
27if [ ! -f $SCENARII_FILE ];
28then
29    echo "Scenario file doesn't exists"
30    exit 3
31fi
32
33# Launch the bootstrap script
34#PATH=$PATH:rel/ucengine/bin ./benchmarks/scenarii/$1.sh localhost
35
36benchmarks/generate.rb $1 $2   > benchmarks/results/$1_$2.xml
37# Update the path to tsung dtd
38SCENARII_FILE_MODIFIED=benchmarks/results/$1_$2.xml
39sed -i "s=TSUNG_SHARE_PATH=$TSUNG_SHARE_PATH=" $SCENARII_FILE_MODIFIED
40ERL_LIBS="benchmarks" tsung -f $SCENARII_FILE_MODIFIED -l "benchmarks/results/$1_$2.log" start
41
42LAST_BENCH=$(pwd)/$(find  benchmarks/results -name "20*" -type d | sort -r | head -1)
43
44cp ./rel/ucengine/log/* $LAST_BENCH
45./rel/ucengine/bin/ucengine-admin fetch_metrics $LAST_BENCH
46cd $LAST_BENCH && tsung_stats.pl --stats $1_$2.log