Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moobench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SustainKieker
moobench
Commits
aecedd0f
Commit
aecedd0f
authored
Jul 21, 2021
by
David Georg Reichelt
Browse files
Options
Downloads
Patches
Plain Diff
Extract common functions and make parameters setable by environment
variables
parent
2de365cc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
frameworks/common-functions.sh
+36
-0
36 additions, 0 deletions
frameworks/common-functions.sh
frameworks/opentelemetry/benchmark.sh
+34
-41
34 additions, 41 deletions
frameworks/opentelemetry/benchmark.sh
with
70 additions
and
41 deletions
frameworks/common-functions.sh
0 → 100644
+
36
−
0
View file @
aecedd0f
#!/bin/bash
function
getSum
{
awk
'{sum += $1; square += $1^2} END {print "Average: "sum/NR" Standard Deviation: "sqrt(square / NR - (sum/NR)^2)" Count: "NR}'
}
## Clean up raw results
function
cleanup-results
()
{
zip
-jqr
${
RESULTS_DIR
}
/results.zip
${
RAWFN
}*
rm
-f
${
RAWFN
}*
[
-f
${
DATA_DIR
}
/nohup.out
]
&&
cp
${
DATA_DIR
}
/nohup.out
${
RESULTS_DIR
}
[
-f
${
DATA_DIR
}
/nohup.out
]
&&
>
${
DATA_DIR
}
/nohup.out
}
# Initialize all unset parameters
if
[
-z
$SLEEPTIME
]
;
then
SLEEPTIME
=
30
## 30
fi
if
[
-z
$NUM_LOOPS
]
;
then
NUM_LOOPS
=
10
## 10
fi
if
[
-z
$THREADS
]
;
then
THREADS
=
1
## 1
fi
if
[
-z
$RECURSIONDEPTH
]
;
then
RECURSIONDEPTH
=
10
## 10
fi
if
[
-z
$TOTALCALLS
]
;
then
TOTALCALLS
=
2000000
## 2000000
fi
if
[
-z
$METHODTIME
]
;
then
METHODTIME
=
0
## 500000
fi
if
[
-z
$DEBUG
]
;
then
DEBUG
=
false
## false
fi
This diff is collapsed.
Click to expand it.
frameworks/opentelemetry/benchmark.sh
+
34
−
41
View file @
aecedd0f
...
@@ -61,7 +61,7 @@ function runNoInstrumentation {
...
@@ -61,7 +61,7 @@ function runNoInstrumentation {
--method-time
${
METHODTIME
}
\
--method-time
${
METHODTIME
}
\
--total-threads
${
THREADS
}
\
--total-threads
${
THREADS
}
\
--recursion-depth
${
j
}
\
--recursion-depth
${
j
}
\
${
MOREPARAMS
}
&>
${
RESULTSDIR
}
output_
"
$i
"
_uninstrumented.txt
${
MOREPARAMS
}
&>
${
RESULTS
_
DIR
}
output_
"
$i
"
_uninstrumented.txt
}
}
function
runOpenTelemetryNoLogging
{
function
runOpenTelemetryNoLogging
{
...
@@ -75,7 +75,7 @@ function runOpenTelemetryNoLogging {
...
@@ -75,7 +75,7 @@ function runOpenTelemetryNoLogging {
--method-time
${
METHODTIME
}
\
--method-time
${
METHODTIME
}
\
--total-threads
${
THREADS
}
\
--total-threads
${
THREADS
}
\
--recursion-depth
${
j
}
\
--recursion-depth
${
j
}
\
${
MOREPARAMS
}
&>
${
RESULTSDIR
}
output_
"
$i
"
_opentelemetry.txt
${
MOREPARAMS
}
&>
${
RESULTS
_
DIR
}
output_
"
$i
"
_opentelemetry.txt
}
}
function
runOpenTelemetryLogging
{
function
runOpenTelemetryLogging
{
...
@@ -89,10 +89,10 @@ function runOpenTelemetryLogging {
...
@@ -89,10 +89,10 @@ function runOpenTelemetryLogging {
--method-time
${
METHODTIME
}
\
--method-time
${
METHODTIME
}
\
--total-threads
${
THREADS
}
\
--total-threads
${
THREADS
}
\
--recursion-depth
${
j
}
\
--recursion-depth
${
j
}
\
${
MOREPARAMS
}
&>
${
RESULTSDIR
}
output_
"
$i
"
_opentelemetry_logging.txt
${
MOREPARAMS
}
&>
${
RESULTS
_
DIR
}
output_
"
$i
"
_opentelemetry_logging.txt
if
[
!
"
$DEBUG
"
=
true
]
if
[
!
"
$DEBUG
"
=
true
]
then
then
rm
${
RESULTSDIR
}
output_
"
$i
"
_opentelemetry_logging.txt
rm
${
RESULTS
_
DIR
}
output_
"
$i
"
_opentelemetry_logging.txt
fi
fi
}
}
...
@@ -108,7 +108,7 @@ function runOpenTelemetryZipkin {
...
@@ -108,7 +108,7 @@ function runOpenTelemetryZipkin {
--method-time
${
METHODTIME
}
\
--method-time
${
METHODTIME
}
\
--total-threads
${
THREADS
}
\
--total-threads
${
THREADS
}
\
--recursion-depth
${
j
}
\
--recursion-depth
${
j
}
\
${
MOREPARAMS
}
&>
${
RESULTSDIR
}
output_
"
$i
"
_opentelemetry_zipkin.txt
${
MOREPARAMS
}
&>
${
RESULTS
_
DIR
}
output_
"
$i
"
_opentelemetry_zipkin.txt
stopBackgroundProcess
stopBackgroundProcess
}
}
...
@@ -140,14 +140,10 @@ function runOpenTelemetryPrometheus {
...
@@ -140,14 +140,10 @@ function runOpenTelemetryPrometheus {
--method-time
${
METHODTIME
}
\
--method-time
${
METHODTIME
}
\
--total-threads
${
THREADS
}
\
--total-threads
${
THREADS
}
\
--recursion-depth
${
j
}
\
--recursion-depth
${
j
}
\
${
MOREPARAMS
}
&>
${
RESULTSDIR
}
output_
"
$i
"
_opentelemetry_prometheus.txt
${
MOREPARAMS
}
&>
${
RESULTS
_
DIR
}
output_
"
$i
"
_opentelemetry_prometheus.txt
stopBackgroundProcess
stopBackgroundProcess
}
}
function
getSum
{
awk
'{sum += $1; square += $1^2} END {print "Average: "sum/NR" Standard Deviation: "sqrt(square / NR - (sum/NR)^2)" Count: "NR}'
}
function
printIntermediaryResults
{
function
printIntermediaryResults
{
echo
-n
"Intermediary results uninstrumented "
echo
-n
"Intermediary results uninstrumented "
cat
results-opentelemetry/raw-
*
-
$RECURSIONDEPTH
-0
.csv |
awk
-F
';'
'{print $2}'
| getSum
cat
results-opentelemetry/raw-
*
-
$RECURSIONDEPTH
-0
.csv |
awk
-F
';'
'{print $2}'
| getSum
...
@@ -178,15 +174,9 @@ JAVABIN=""
...
@@ -178,15 +174,9 @@ JAVABIN=""
RSCRIPTDIR
=
r/
RSCRIPTDIR
=
r/
BASEDIR
=
./
BASEDIR
=
./
RESULTSDIR
=
"
${
BASEDIR
}
results-opentelemetry/"
RESULTS
_
DIR
=
"
${
BASEDIR
}
results-opentelemetry/"
SLEEPTIME
=
30
## 30
source
../common-functions.sh
NUM_LOOPS
=
10
## 10
THREADS
=
1
## 1
RECURSIONDEPTH
=
10
## 10
TOTALCALLS
=
2000000
## 2000000
METHODTIME
=
0
## 500000
DEBUG
=
false
## false
#MOREPARAMS="--quickstart"
#MOREPARAMS="--quickstart"
MOREPARAMS
=
"--application moobench.application.MonitoredClassSimple
${
MOREPARAMS
}
"
MOREPARAMS
=
"--application moobench.application.MonitoredClassSimple
${
MOREPARAMS
}
"
...
@@ -194,15 +184,15 @@ MOREPARAMS="--application moobench.application.MonitoredClassSimple ${MOREPARAMS
...
@@ -194,15 +184,15 @@ MOREPARAMS="--application moobench.application.MonitoredClassSimple ${MOREPARAMS
TIME
=
`
expr
${
METHODTIME
}
\*
${
TOTALCALLS
}
/ 1000000000
\*
4
\*
${
RECURSIONDEPTH
}
\*
${
NUM_LOOPS
}
+
${
SLEEPTIME
}
\*
4
\*
${
NUM_LOOPS
}
\*
${
RECURSIONDEPTH
}
+ 50
\*
${
TOTALCALLS
}
/ 1000000000
\*
4
\*
${
RECURSIONDEPTH
}
\*
${
NUM_LOOPS
}
`
TIME
=
`
expr
${
METHODTIME
}
\*
${
TOTALCALLS
}
/ 1000000000
\*
4
\*
${
RECURSIONDEPTH
}
\*
${
NUM_LOOPS
}
+
${
SLEEPTIME
}
\*
4
\*
${
NUM_LOOPS
}
\*
${
RECURSIONDEPTH
}
+ 50
\*
${
TOTALCALLS
}
/ 1000000000
\*
4
\*
${
RECURSIONDEPTH
}
\*
${
NUM_LOOPS
}
`
echo
"Experiment will take circa
${
TIME
}
seconds."
echo
"Experiment will take circa
${
TIME
}
seconds."
echo
"
Remov
ing and recreating '
$RESULTSDIR
'"
echo
"
Clean
ing and recreating '
$RESULTS
_
DIR
'"
(
rm
-rf
${
RESULTSDIR
}
)
&&
mkdir
-p
${
RESULTSDIR
}
(
rm
-rf
${
RESULTS
_
DIR
}
/
**
csv
)
&&
mkdir
-p
${
RESULTS
_
DIR
}
#mkdir ${RESULTSDIR}stat/
#mkdir ${RESULTS
_
DIR}stat/
# Clear opentelemetry.log and initialize logging
# Clear opentelemetry.log and initialize logging
rm
-f
${
BASEDIR
}
opentelemetry.log
rm
-f
${
BASEDIR
}
opentelemetry.log
touch
${
BASEDIR
}
opentelemetry.log
touch
${
BASEDIR
}
opentelemetry.log
RAWFN
=
"
${
RESULTSDIR
}
raw"
RAWFN
=
"
${
RESULTS
_
DIR
}
raw"
JAVAARGS
=
"-server"
JAVAARGS
=
"-server"
JAVAARGS
=
"
${
JAVAARGS
}
"
JAVAARGS
=
"
${
JAVAARGS
}
"
...
@@ -236,18 +226,18 @@ JAVAARGS_OPENTELEMETRY_PROMETHEUS="${JAVAARGS_OPENTELEMETRY_BASIC} -Dotel.traces
...
@@ -236,18 +226,18 @@ JAVAARGS_OPENTELEMETRY_PROMETHEUS="${JAVAARGS_OPENTELEMETRY_BASIC} -Dotel.traces
## Write configuration
## Write configuration
uname
-a
>
${
RESULTSDIR
}
configuration.txt
uname
-a
>
${
RESULTS
_
DIR
}
configuration.txt
${
JAVABIN
}
java
${
JAVAARGS
}
-version
2>>
${
RESULTSDIR
}
configuration.txt
${
JAVABIN
}
java
${
JAVAARGS
}
-version
2>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"JAVAARGS:
${
JAVAARGS
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"JAVAARGS:
${
JAVAARGS
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
""
>>
${
RESULTSDIR
}
configuration.txt
echo
""
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"Runtime: circa
${
TIME
}
seconds"
>>
${
RESULTSDIR
}
configuration.txt
echo
"Runtime: circa
${
TIME
}
seconds"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
""
>>
${
RESULTSDIR
}
configuration.txt
echo
""
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"SLEEPTIME=
${
SLEEPTIME
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"SLEEPTIME=
${
SLEEPTIME
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"NUM_LOOPS=
${
NUM_LOOPS
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"NUM_LOOPS=
${
NUM_LOOPS
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"TOTALCALLS=
${
TOTALCALLS
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"TOTALCALLS=
${
TOTALCALLS
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"METHODTIME=
${
METHODTIME
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"METHODTIME=
${
METHODTIME
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"THREADS=
${
THREADS
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"THREADS=
${
THREADS
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
echo
"RECURSIONDEPTH=
${
RECURSIONDEPTH
}
"
>>
${
RESULTSDIR
}
configuration.txt
echo
"RECURSIONDEPTH=
${
RECURSIONDEPTH
}
"
>>
${
RESULTS
_
DIR
}
configuration.txt
sync
sync
## Execute Benchmark
## Execute Benchmark
...
@@ -284,14 +274,17 @@ for ((i=1;i<=${NUM_LOOPS};i+=1)); do
...
@@ -284,14 +274,17 @@ for ((i=1;i<=${NUM_LOOPS};i+=1)); do
printIntermediaryResults
printIntermediaryResults
done
done
#zip -jqr ${RESULTSDIR}stat.zip ${RESULTSDIR}stat
#rm -rf ${RESULTSDIR}stat/
cleanup-results
mv
${
BASEDIR
}
opentelemetry.log
${
RESULTSDIR
}
opentelemetry.log
[
-f
${
RESULTSDIR
}
hotspot-1-
${
RECURSIONDEPTH
}
-1
.log
]
&&
grep
"<task "
${
RESULTSDIR
}
hotspot-
*
.log
>
${
RESULTSDIR
}
log.log
#zip -jqr ${RESULTS_DIR}stat.zip ${RESULTS_DIR}stat
[
-f
${
BASEDIR
}
errorlog.txt
]
&&
mv
${
BASEDIR
}
errorlog.txt
${
RESULTSDIR
}
#rm -rf ${RESULTS_DIR}stat/
mv
${
BASEDIR
}
opentelemetry.log
${
RESULTS_DIR
}
opentelemetry.log
[
-f
${
RESULTS_DIR
}
hotspot-1-
${
RECURSIONDEPTH
}
-1
.log
]
&&
grep
"<task "
${
RESULTS_DIR
}
hotspot-
*
.log
>
${
RESULTS_DIR
}
log.log
[
-f
${
BASEDIR
}
errorlog.txt
]
&&
mv
${
BASEDIR
}
errorlog.txt
${
RESULTS_DIR
}
## Clean up raw results
## Clean up raw results
#gzip -qr ${RESULTSDIR}results.zip ${RAWFN}*
#gzip -qr ${RESULTS
_
DIR}results.zip ${RAWFN}*
#rm -f ${RAWFN}*
#rm -f ${RAWFN}*
[
-f
${
BASEDIR
}
nohup.out
]
&&
cp
${
BASEDIR
}
nohup.out
${
RESULTSDIR
}
[
-f
${
BASEDIR
}
nohup.out
]
&&
cp
${
BASEDIR
}
nohup.out
${
RESULTS
_
DIR
}
[
-f
${
BASEDIR
}
nohup.out
]
&&
>
${
BASEDIR
}
nohup.out
[
-f
${
BASEDIR
}
nohup.out
]
&&
>
${
BASEDIR
}
nohup.out
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment