summaryrefslogtreecommitdiffstats
path: root/s3p/generate_perf.sh
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2018-11-07 17:59:37 +0800
committerLianhao Lu <lianhao.lu@intel.com>2018-11-12 09:41:24 +0800
commit4fc3562b400a0dbbd64df7a09dccca8fe79ec3c3 (patch)
tree00c7fc6ee13fc53563c8c04bb63d74066df41df4 /s3p/generate_perf.sh
parentade9dd78608af57112877f4e4bade18c3af42371 (diff)
Added JMeter scripts for perf test
Change-Id: I4286c6defdef331ee5c40399d17381d3c8b8a544 Issue-ID: POLICY-836 Signed-off-by: Lianhao Lu <lianhao.lu@intel.com> (cherry picked from commit c1647ba56080a79d149b2e9fd647bda4da39997e)
Diffstat (limited to 's3p/generate_perf.sh')
-rwxr-xr-xs3p/generate_perf.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/s3p/generate_perf.sh b/s3p/generate_perf.sh
new file mode 100755
index 00000000..beabb783
--- /dev/null
+++ b/s3p/generate_perf.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+function print_usage_and_exit {
+ [ -z "$1" ] || echo "Error: $1"
+ echo "Usage: $0 <output_dir> <total>"
+ echo " - <output_dir>: directory where the generated csar file will be put into"
+ echo " - <total>: total number of csar files to be generated"
+ exit 1
+}
+
+[ "$#" -ne 2 ] && print_usage_and_exit
+OUTPUT=$1
+TOTAL=$2
+
+[ -d $OUTPUT ] || mkdir -p $OUTPUT
+[ -d $OUTPUT ] || print_usage_and_exit "$OUTPUT is not a valid directory"
+[[ $TOTAL =~ ^[0-9]+$ ]] || print_usage_and_exit "$SEED is not a integer"
+
+
+ROOT_DIR=`dirname $(readlink -f $0)`
+TMP_DIR=$ROOT_DIR/perf_tmp
+
+python $ROOT_DIR/generate_perf.py --dest $TMP_DIR --total $TOTAL --out $ROOT_DIR/perf_data.csv
+
+rm -f $OUTPUT/*.csar
+cp -fr $TMP_DIR/*.csar $OUTPUT/
+
+rm -rf $TMP_DIR