Newer
Older
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
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# Kieker benchmark script
#
# Usage: benchmark.sh [execute|test]
# configure base dir
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
#
# source functionality
#
if [ ! -d "${BASE_DIR}" ] ; then
echo "Base directory ${BASE_DIR} does not exist."
exit 1
fi
# load configuration and common functions
if [ -f "${BASE_DIR}/config.rc" ] ; then
source "${BASE_DIR}/config.rc"
else
echo "Missing configuration: ${BASE_DIR}/config.rc"
exit 1
fi
if [ -f "${MAIN_DIR}/frameworks/common-functions.sh" ] ; then
source "${MAIN_DIR}/frameworks/common-functions.sh"
else
echo "Missing library: ${MAIN_DIR}/frameworks/common-functions.sh"
exit 1
fi
if [ -f "${BASE_DIR}/functions.sh" ] ; then
source "${BASE_DIR}/functions.sh"
else
echo "Missing: ${BASE_DIR}/functions.sh"
exit 1
fi
if [ -f "${BASE_DIR}/labels.sh" ] ; then
source "${BASE_DIR}/labels.sh"
else
echo "Missing file: ${BASE_DIR}/labels.sh"
exit 1
fi
#
# Setup
#
info "----------------------------------"
info "Setup..."
info "----------------------------------"
cd "${BASE_DIR}"
# load agent
getAgent
checkDirectory data-dir "${DATA_DIR}" create
checkDirectory results-directory "${RESULTS_DIR}" recreate
PARENT=`dirname "${RESULTS_DIR}"`
checkDirectory result-base "${PARENT}"
# Find receiver and extract it
checkFile receiver "${RECEIVER_ARCHIVE}"
tar -xpf "${RECEIVER_ARCHIVE}"
RECEIVER_BIN="${BASE_DIR}/receiver/bin/receiver"
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
checkFile R-script "${RSCRIPT_PATH}"
checkFile log "${DATA_DIR}/kieker.log" clean
showParameter
TIME=`expr ${METHOD_TIME} \* ${TOTAL_NUM_OF_CALLS} / 1000000000 \* 4 \* ${RECURSION_DEPTH} \* ${NUM_OF_LOOPS} + ${SLEEP_TIME} \* 4 \* ${NUM_OF_LOOPS} \* ${RECURSION_DEPTH} + 50 \* ${TOTAL_NUM_OF_CALLS} / 1000000000 \* 4 \* ${RECURSION_DEPTH} \* ${NUM_OF_LOOPS} `
info "Experiment will take circa ${TIME} seconds."
# JAVA_ARGS used to configure and setup a specific writer
declare -a WRITER_CONFIG
# Receiver setup if necessary
declare -a RECEIVER
# Title
declare -a TITLE
RECEIVER[5]="${RECEIVER_BIN} 2345"
#
# Write configuration
#
uname -a > "${RESULTS_DIR}/configuration.txt"
cat << EOF >> "${RESULTS_DIR}/configuration.txt"
Runtime: circa ${TIME} seconds
SLEEP_TIME=${SLEEP_TIME}
NUM_OF_LOOPS=${NUM_OF_LOOPS}
TOTAL_NUM_OF_CALLS=${TOTAL_NUM_OF_CALLS}
METHOD_TIME=${METHOD_TIME}
RECURSION_DEPTH=${RECURSION_DEPTH}
EOF
info "Ok"
sync
#
# Run benchmark
#
info "----------------------------------"
info "Running benchmark..."
info "----------------------------------"