-
Notifications
You must be signed in to change notification settings - Fork 0
/
execute-observation.sh
executable file
·141 lines (103 loc) · 3.88 KB
/
execute-observation.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/bash
# Run an JPetStore and collect all events.
# Requires
# - JPETSTORE runner script which also runs a workload driver
# - collector
# Parameter
# - $1 = workload path, optional
# execute setup
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
if [ -f $BASE_DIR/config ] ; then
. $BASE_DIR/config
else
echo "Missing configuration"
exit 1
fi
. $BASE_DIR/common-functions.sh
###################################
# check setup
checkDirectory "Data" $DATA_DIR
checkExecutable Collector "${COLLECTOR}"
checkExecutable JPetStore "$JPETSTORE"
checkFile log-configuration $BASE_DIR/log4j.cfg
###################################
# check parameters
if [ "$1" == "" ] ; then
export INTERACTIVE="yes"
export EXPERIMENT_ID="interactive"
information "Interactive mode no specialized workload driver"
else
export INTERACTIVE="no"
checkFile workload "$1"
WORKLOAD_CONFIGURATION="$1"
export EXPERIMENT_ID=`basename "$WORKLOAD_CONFIGURATION" | sed 's/\.yaml$//g'`
information "Automatic mode, workload driver is ${WORKLOAD_PATH}"
fi
export COLLECTOR_DATA_DIR="${DATA_DIR}/${EXPERIMENT_ID}"
###################################
# main script
information "--------------------------------------------------------------------"
information "$EXPERIMENT_ID $WORKLOAD_CONFIGURATION"
information "--------------------------------------------------------------------"
###################################
# stoping services
# stop collector
information "Stopping collector ..."
COLLECTOR_PID=`ps auxw | grep "/collector" | grep -v grep | awk '{ print $2 }' | head -1`
while [ "${COLLECTOR_PID}" != "" ] ; do
COLLECTOR_PID=`ps auxw | grep "/collector" | grep -v grep | awk '{ print $2 }' | head -1`
echo "stopping ${COLLECTOR_PID}"
kill -TERM $COLLECTOR_PID
done
information "done"
echo ""
# remove old data
information "Cleaning data"
rm -rf $COLLECTOR_DATA_DIR/*
mkdir -p $COLLECTOR_DATA_DIR
###################################
# start experiment
information "Deploying experiment..."
##
# collector
information "Start collector"
# configure collector
cat << EOF > collector.config
# common
kieker.monitoring.name=${EXPERIMENT_ID}
kieker.monitoring.hostname=
kieker.monitoring.metadata=true
# TCP collector
iobserve.service.reader=org.iobserve.service.source.MultipleConnectionTcpCompositeStage
org.iobserve.service.source.MultipleConnectionTcpCompositeStage.port=9876
org.iobserve.service.source.MultipleConnectionTcpCompositeStage.capacity=8192
# dump stage
kieker.monitoring.writer=kieker.monitoring.writer.filesystem.FileWriter
kieker.monitoring.writer.filesystem.FileWriter.customStoragePath=$COLLECTOR_DATA_DIR/
kieker.monitoring.writer.filesystem.FileWriter.charsetName=UTF-8
kieker.monitoring.writer.filesystem.FileWriter.maxEntriesInFile=25000
kieker.monitoring.writer.filesystem.FileWriter.maxLogSize=-1
kieker.monitoring.writer.filesystem.FileWriter.maxLogFiles=-1
kieker.monitoring.writer.filesystem.FileWriter.mapFileHandler=kieker.monitoring.writer.filesystem.TextMapFileHandler
kieker.monitoring.writer.filesystem.TextMapFileHandler.flush=true
kieker.monitoring.writer.filesystem.TextMapFileHandler.compression=kieker.monitoring.writer.filesystem.compression.NoneCompressionFilter
kieker.monitoring.writer.filesystem.FileWriter.logFilePoolHandler=kieker.monitoring.writer.filesystem.RotatingLogFilePoolHandler
kieker.monitoring.writer.filesystem.FileWriter.logStreamHandler=kieker.monitoring.writer.filesystem.TextLogStreamHandler
kieker.monitoring.writer.filesystem.FileWriter.flush=true
kieker.monitoring.writer.filesystem.FileWriter.bufferSize=81920
EOF
export COLLECTOR_OPTS=-Dlog4j.configuration=file:///$BASE_DIR/log4j.cfg
$COLLECTOR -c collector.config &
COLLECTOR_PID=$!
sleep 10
# run jpetstore
$JPETSTORE "${WORKLOAD_CONFIGURATION}"
# finally stop the collector
information "Stopping collector"
kill -TERM ${COLLECTOR_PID}
rm collector.config
wait ${COLLECTOR_PID}
#
rm collector.config
information "Experiment complete."
# end