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
2de365cc
Commit
2de365cc
authored
Jul 21, 2021
by
David Georg Reichelt
Browse files
Options
Downloads
Patches
Plain Diff
Add script for execution of R analysis without benchmark
parent
041bce91
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/getConfidenceIntervalTable/getConfidenceIntervalTable.sh
+75
-0
75 additions, 0 deletions
.../getConfidenceIntervalTable/getConfidenceIntervalTable.sh
tools/getConfidenceIntervalTable/stats.csv.r
+108
-0
108 additions, 0 deletions
tools/getConfidenceIntervalTable/stats.csv.r
with
183 additions
and
0 deletions
tools/getConfidenceIntervalTable/getConfidenceIntervalTable.sh
0 → 100755
+
75
−
0
View file @
2de365cc
#!/bin/bash
## Generate Results file
function
run-r
()
{
R
--vanilla
--silent
<<
EOF
results_fn="
${
RAWFN
}
"
outtxt_fn="
${
RESULTS_DIR
}
/results-text.txt"
outcsv_fn="
${
RESULTS_DIR
}
/results-text.csv"
configs.loop=
${
NUM_OF_LOOPS
}
configs.recursion=
${
RECURSION_DEPTH
}
configs.labels=c(
$LABELS
)
results.count=
${
TOTAL_NUM_OF_CALLS
}
results.skip=
${
TOTAL_NUM_OF_CALLS
}
/2
source("
${
RSCRIPT_PATH
}
")
EOF
}
function
createVariantsString
{
local
LABELS
=
""
local
variants
=
$(
ls
$RESULTS_DIR
|
grep
".csv"
|
awk
-F
'[.-]'
'{print $4}'
|
sort
|
uniq
|
sed
'/^[[:space:]]*$/d'
)
for
variant
in
$variants
do
if
[
-z
"
$LABELS
"
]
then
LABELS
=
"
\"
$variant
\"
"
else
LABELS
=
"
$LABELS
,
\"
$variant
\"
"
fi
done
echo
$LABELS
}
function
createLatexTable
{
cat
$RESULTS_DIR
/results-text.txt |
tail
-n
8
>
transposeMe.csv
awk
'
{
for (i=1; i<=NF; i++) {
a[NR,i] = $i
}
}
NF>p { p = NF }
END {
for(j=1; j<=p; j++) {
str=a[1,j]
for(i=2; i<=NR; i++){
str=str" "a[i,j];
}
print str
}
}'
transposeMe.csv
>
transposed.csv
cat
transposed.csv |
awk
'{print "["$1-$3";"$1+$3"] & "$2}'
}
if
[
"$#"
-lt
1
]
then
echo
"Please pass folder with MooBench CSV files for analysis!"
exit
1
fi
RESULTS_DIR
=
$1
RAWFN
=
$RESULTS_DIR
/raw
NUM_OF_LOOPS
=
10
RECURSION_DEPTH
=
10
TOTAL_NUM_OF_CALLS
=
2000000
LABELS
=
$(
createVariantsString
)
RSCRIPT_PATH
=
$MOOBENCH_HOME
/frameworks/Kieker/scripts/stats.csv.r
run-r
createLatexTable
This diff is collapsed.
Click to expand it.
tools/getConfidenceIntervalTable/stats.csv.r
0 → 100644
+
108
−
0
View file @
2de365cc
############################################
# R - script to collect all moobench results
############################################
# these values are here only as documentation. The parameters are set by benchmark.sh
#rm(list=ls(all=TRUE))
#data_fn="data/"
#folder_fn="results-benchmark-binary"
#results_fn=paste(data_fn,folder_fn,"/raw",sep="")
#outtxt_fn=paste(data_fn,folder_fn,"/results-text.txt",sep="")
#results_fn="raw"
#outtxt_fn="results-text.txt"
#########
# These are configuration parameters which are automatically prepended to this file by the benchmark.sh script.
# Therefore, they must not be set here. The following lines only serve as documentation.
#configs.loop=10
#configs.recursion=c(10)
#configs.labels=c("No Probe","Inactive Probe","Collecting Data","Writing Data (ASCII)", "Writing Data (Bin)")
#results.count=2000000
#results.skip=1000000
#bars.minval=500
#bars.maxval=600
##########
# Process configuration
# divisor 1 = nano, 1000 = micro, 1000000 = milli seconds
timeUnit
<-
1000
# number of Kieker writer configurations
numberOfWriters
<-
length
(
configs.labels
)
recursion_depth
<-
configs.recursion
numberOfValues
<-
configs.loop
*
(
results.count
-
results.skip
)
numbers
<-
c
(
1
:
(
numberOfValues
))
resultDimensionNames
<-
list
(
configs.labels
,
numbers
)
# result values
resultsBIG
<-
array
(
dim
=
c
(
numberOfWriters
,
numberOfValues
),
dimnames
=
resultDimensionNames
)
##########
# Create result
## "[ recursion , config , loop ]"
numOfRowsToRead
<-
results.count
-
results.skip
for
(
writer_idx
in
(
1
:
numberOfWriters
))
{
recordsPerSecond
=
c
()
rpsLastDuration
=
0
rpsCount
=
0
file_idx
<-
writer_idx
-
1
# loop
for
(
loop_counter
in
(
1
:
configs.loop
))
{
results_fn_filepath
<-
paste
(
results_fn
,
"-"
,
loop_counter
,
"-"
,
recursion_depth
,
"-"
,
file_idx
,
".csv"
,
sep
=
""
)
message
(
results_fn_filepath
)
results
<-
read.csv2
(
results_fn_filepath
,
nrows
=
numOfRowsToRead
,
skip
=
results.skip
,
quote
=
""
,
colClasses
=
c
(
"NULL"
,
"numeric"
,
"numeric"
,
"numeric"
),
comment.char
=
""
,
col.names
=
c
(
"thread_id"
,
"duration_nsec"
,
"gc"
,
"t"
),
header
=
FALSE
)
trx_idx
<-
c
(
1
:
numOfRowsToRead
)
resultsBIG
[
writer_idx
,
trx_idx
]
<-
results
[[
"duration_nsec"
]]
}
}
qnorm_value
<-
qnorm
(
0.975
)
# print results
printDimensionNames
<-
list
(
c
(
"mean"
,
"sd"
,
"ci95%"
,
"md25%"
,
"md50%"
,
"md75%"
,
"max"
,
"min"
),
c
(
1
:
numberOfWriters
))
# row number == number of computed result values, e.g., mean, min, max
printvalues
<-
matrix
(
nrow
=
8
,
ncol
=
numberOfWriters
,
dimnames
=
printDimensionNames
)
for
(
writer_idx
in
(
1
:
numberOfWriters
))
{
idx_mult
<-
c
(
1
:
numOfRowsToRead
)
valuesBIG
<-
resultsBIG
[
writer_idx
,
idx_mult
]
/
timeUnit
printvalues
[
"mean"
,
writer_idx
]
<-
mean
(
valuesBIG
)
printvalues
[
"sd"
,
writer_idx
]
<-
sd
(
valuesBIG
)
printvalues
[
"ci95%"
,
writer_idx
]
<-
qnorm_value
*
sd
(
valuesBIG
)
/
sqrt
(
length
(
valuesBIG
))
printvalues
[
c
(
"md25%"
,
"md50%"
,
"md75%"
),
writer_idx
]
<-
quantile
(
valuesBIG
,
probs
=
c
(
0.25
,
0.5
,
0.75
))
printvalues
[
"max"
,
writer_idx
]
<-
max
(
valuesBIG
)
printvalues
[
"min"
,
writer_idx
]
<-
min
(
valuesBIG
)
}
resultstext
<-
formatC
(
printvalues
,
format
=
"f"
,
digits
=
4
,
width
=
8
)
print
(
resultstext
)
write
(
paste
(
"Recursion Depth: "
,
recursion_depth
),
file
=
outtxt_fn
,
append
=
TRUE
)
write
(
"response time"
,
file
=
outtxt_fn
,
append
=
TRUE
)
write.table
(
resultstext
,
file
=
outtxt_fn
,
append
=
TRUE
,
quote
=
FALSE
,
sep
=
"\t"
,
col.names
=
FALSE
)
concResult
<-
""
headResult
<-
""
# write the first n-1 elements preceded by a comma (,)
for
(
writer_idx
in
(
1
:
(
numberOfWriters
-1
)))
{
headResult
<-
paste
(
headResult
,
configs.labels
[
writer_idx
],
","
)
concResult
<-
paste
(
concResult
,
printvalues
[
"mean"
,
writer_idx
],
","
)
}
# write the last without a comma
headResult
<-
paste
(
headResult
,
configs.labels
[
numberOfWriters
])
concResult
<-
paste
(
concResult
,
printvalues
[
"mean"
,
numberOfWriters
])
write
(
headResult
,
file
=
outcsv_fn
,
append
=
TRUE
)
write
(
concResult
,
file
=
outcsv_fn
,
append
=
TRUE
)
# end
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