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