blob: c0ca9a4caa9d7da3887add3b15ca733e6366adf6 [file] [log] [blame]
Yulia Portnovab0c977c2015-12-11 19:23:28 +02001#!/bin/bash
2
3set -e
4
5
6while [[ $# > 1 ]]
7do
8key="$1"
9
10case $key in
11 url)
12 URL="$2"
13 shift
14 ;;
Yulia Portnova2be79a92015-12-22 12:46:10 +020015 timeout)
16 TIMEOUT="$2"
17 shift
18 ;;
19 concurrency)
20 CONC="$2"
21 shift
22 ;;
Yulia Portnovab0c977c2015-12-11 19:23:28 +020023 times)
24 TIMES="$2"
25 shift
26 ;;
27 *)
28 echo "Unknown option $key"
29 exit 1
30 ;;
31esac
32shift
33done
34
35OMGPATN=/tmp
36
37cd "$OMGPATN"
38source venv/bin/activate
39
40cd omgbenchmark/rally_plugin
41
Yulia Portnovae488cd02015-12-15 15:18:00 +020042sed -i -e "s+rabbit:\/\/guest:guest@localhost\/+$URL+g" deployment.json
Yulia Portnova2be79a92015-12-22 12:46:10 +020043sed -i -e "s,timeout\": 100,timeout\": $TIMEOUT,g" task_timeout.json
44sed -i -e "s,concurrency\": 40,concurrency\": $CONC,g" task_timeout.json
45sed -i -e "s,times\": 40,times\": $TIMES,g" task_timeout.json
Yulia Portnovab0c977c2015-12-11 19:23:28 +020046
Yulia Portnovac7d52b52015-12-15 15:16:34 +020047rally --plugin-paths . deployment create --file=deployment.json --name=test &> /dev/null
Yulia Portnova2be79a92015-12-22 12:46:10 +020048rally --plugin-paths . task start task_timeout.json &> ~/omg.log
Yulia Portnova2b63d582015-12-14 15:16:52 +020049
Yulia Portnova2be79a92015-12-22 12:46:10 +020050cat ~/omg.log | grep "Messages count" | grep -o '[0-9,.]\+' | tail -1
Yulia Portnova2b63d582015-12-14 15:16:52 +020051cat ~/omg.log | grep "total" | grep -o '[0-9,.]\+%' | grep -o '[0-9,.]\+'
52cat ~/omg.log | grep "Load duration" | grep -o '[0-9,.]\+'