-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-benchmarks.sh
executable file
·50 lines (44 loc) · 1.17 KB
/
run-benchmarks.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
VERSIONS="5.1.0.Final 5.1.1.SP2";
BENCHMARKS="";
OUTPUT_PATH="$PWD/target/report"
MVN_CMD="mvn"
JAVA_OPTS=""
while getopts ":v:b:o:m:j:" opt; do
case $opt in
v) VERSIONS="$OPTARG"
;;
b) BENCHMARKS="$OPTARG"
;;
o) OUTPUT_PATH="$OPTARG"
;;
m) MVN_CMD="$OPTARG"
;;
j) JAVA_OPTS="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
;;
esac
done
if [ -n "$BENCHMARKS" ]; then
echo "Specific benchmarks to run: $BENCHMARKS"
fi
echo "I'm about to run benchmarks for versions: $VERSIONS";
echo "Using JVM options: $JAVA_OPTS"
echo "Using maven command: $MVN_CMD"
$MVN_CMD --version
RESULT_FILES="";
for i in $(echo $VERSIONS)
do
if [[ "${i}" == "5"* ]];
then
# Activate Weld 5 profile
$MVN_CMD package -Dversion.weld=$i -Pweld5
else
$MVN_CMD package -Dversion.weld=$i
fi
java $JAVA_OPTS -jar target/weld-core-benchmarks.jar -rf json -rff target/results-$i.json $BENCHMARKS
RESULT_FILES="$RESULT_FILES target/results-$i.json"
done;
echo "Generate report from $RESULT_FILES in $OUTPUT_PATH"
java -cp target/weld-core-benchmarks.jar org.jboss.weld.benchmark.report.ReportGenerator "$RESULT_FILES" $OUTPUT_PATH