Skip to content
Snippets Groups Projects
Commit 8845f336 authored by Jan Waller's avatar Jan Waller
Browse files

Clean up, restructure, add Kieker Scripts

parent 89005cea
No related branches found
No related tags found
No related merge requests found
Showing
with 798 additions and 13 deletions
File moved
File moved
File moved
File moved
File moved
#rm(list=ls(all=TRUE))
#data_fn="tmp/"
#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="")
configs.threads=1
#configs.loop=10
#configs.recursion=c(10)
#configs.labels=c("No Probe","Inactive Probe","Collecting Data","Writing Data")
configs.count=length(configs.labels)
#results.count=2000000
#results.skip=1000000
#bars.minval=500
#bars.maxval=600
throughput = array(list(),dim=c(length(configs.recursion),configs.count))
## "[ recursion , config , loop ]"
resultsBIG <- array(dim=c(length(configs.recursion),configs.count,configs.threads*configs.loop*(results.count-results.skip)),dimnames=list(configs.recursion,configs.labels,c(1:(configs.threads*configs.loop*(results.count-results.skip)))))
for (cr in configs.recursion) {
for (cc in (1:configs.count)) {
recordsPerSecond = c()
rpsLastTime = 0
rpsCount = 0
for (cl in (1:configs.loop)) {
results_fn_temp=paste(results_fn, "-", cl, "-", cr, "-", cc, ".csv", sep="")
for (ct in (1:configs.threads)) {
results=read.csv2(results_fn_temp,nrows=(results.count-results.skip),skip=(ct-1)*results.count+results.skip,quote="",colClasses=c("NULL","numeric"),comment.char="",col.names=c("thread_id","duration_nsec"),header=FALSE)
resultsBIG[(1:length(configs.recursion))[configs.recursion==cr],cc,c(((cl-1)*configs.threads*(results.count-results.skip)+1):(cl*configs.threads*(results.count-results.skip)))] <- results[["duration_nsec"]]/(1000)
for (timeForRecord in results[["duration_nsec"]]) {
if (rpsLastTime + timeForRecord >= 1000000000) {
recordsPerSecond <- c(recordsPerSecond, rpsCount)
rpsCount = 0
rpsLastTime = 1000000000 - rpsLastTime
}
while (timeForRecord > 1000000000) {
recordsPerSecond <- c(recordsPerSecond, 0)
timeForRecord = timeForRecord - 1000000000
}
rpsCount = rpsCount + 1
rpsLastTime = rpsLastTime + timeForRecord
}
}
rm(results,results_fn_temp)
}
recordsPerSecond <- c(recordsPerSecond, rpsCount)
throughput[[(1:length(configs.recursion))[configs.recursion==cr],cc]] <- recordsPerSecond
rm(recordsPerSecond,rpsLastTime,rpsCount)
}
}
for (cr in configs.recursion) {
printvalues = matrix(nrow=5,ncol=configs.count,dimnames=list(c("mean","ci95%","md25%","md50%","md75%"),c(1:configs.count)))
printthrough = matrix(nrow=5,ncol=configs.count,dimnames=list(c("mean","ci95%","md25%","md50%","md75%"),c(1:configs.count)))
for (cc in (1:configs.count)) {
printvalues["mean",cc]=mean(resultsBIG[(1:length(configs.recursion))[configs.recursion==cr],cc,c(1:(results.count-results.skip))])
printvalues["ci95%",cc]=qnorm(0.975)*sd(resultsBIG[(1:length(configs.recursion))[configs.recursion==cr],cc,c(1:(results.count-results.skip))])/sqrt(length(resultsBIG[(1:length(configs.recursion))[configs.recursion==cr],cc,c(1:(results.count-results.skip))]))
printvalues[c("md25%","md50%","md75%"),cc]=quantile(resultsBIG[(1:length(configs.recursion))[configs.recursion==cr],cc,c(1:(results.count-results.skip))],probs=c(0.25,0.5,0.75))
printthrough["mean",cc]=mean(throughput[[(1:length(configs.recursion))[configs.recursion==cr],cc]])
printthrough["ci95%",cc]=qnorm(0.975)*sd(throughput[[(1:length(configs.recursion))[configs.recursion==cr],cc]])/sqrt(length(throughput[[(1:length(configs.recursion))[configs.recursion==cr],cc]]))
printthrough[c("md25%","md50%","md75%"),cc]=quantile(throughput[[(1:length(configs.recursion))[configs.recursion==cr],cc]],probs=c(0.25,0.5,0.75))
}
resultstext=formatC(printvalues,format="f",digits=4,width=8)
throughtext=formatC(printthrough,format="f",digits=1,width=12)
print(resultstext)
write(paste("Recursion Depth: ", cr),file=outtxt_fn,append=TRUE)
write.table(resultstext,file=outtxt_fn,append=TRUE,quote=FALSE,sep="\t",col.names=FALSE)
write("Throughput",file=outtxt_fn,append=TRUE)
write.table(throughtext,file=outtxt_fn,append=TRUE,quote=FALSE,sep="\t",col.names=FALSE)
}
...@@ -14,12 +14,19 @@ ...@@ -14,12 +14,19 @@
<path id="compile-classpath"> <path id="compile-classpath">
<fileset dir="lib/"> <fileset dir="lib/">
<include name="commons-cli-*.jar" /> <include name="commons-cli-*.jar" />
<include name="kieker-*.jar" /> <include name="frameworks/Kieker/lib/kieker-*.jar" />
</fileset>
<fileset dir="frameworks/Kieker/lib/">
<include name="*.jar" />
</fileset> </fileset>
</path> </path>
<javac source="1.5" target="1.5" destDir="build" debug="true" classpathref="compile-classpath" srcdir="src" includeAntRuntime="false" /> <javac source="1.5" target="1.5" destDir="build" debug="true" classpathref="compile-classpath" includeAntRuntime="false">
<src path="src" />
<src path="frameworks/Kieker/src" />
</javac>
<copy todir="build/META-INF"> <copy todir="build/META-INF">
<fileset dir="src/META-INF" /> <fileset dir="src/META-INF" />
<fileset dir="frameworks/Kieker/src/META-INF" />
</copy> </copy>
</target> </target>
...@@ -28,6 +35,7 @@ ...@@ -28,6 +35,7 @@
<classpath> <classpath>
<fileset dir="lib/"> <fileset dir="lib/">
<include name="**/*.jar" /> <include name="**/*.jar" />
<exclude name="commons-cli-*.jar" />
</fileset> </fileset>
</classpath> </classpath>
</manifestclasspath> </manifestclasspath>
...@@ -35,9 +43,10 @@ ...@@ -35,9 +43,10 @@
<fileset dir="build" /> <fileset dir="build" />
<fileset dir="." includes="LICENSE README" /> <fileset dir="." includes="LICENSE README" />
<manifest> <manifest>
<attribute name="Main-Class" value="kieker.evaluation.benchmark.Benchmark" /> <attribute name="Main-Class" value="mooBench.benchmark.Benchmark" />
<attribute name="Class-Path" value="${jar.classpath}" /> <attribute name="Class-Path" value="${jar.classpath}" />
</manifest> </manifest>
<zipfileset src="lib/commons-cli-1.2.jar" />
</jar> </jar>
</target> </target>
......
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#!/bin/bash
JAVABIN="/localhome/jwa/jdk/bin/"
RSCRIPTDIR=bin/r/
BASEDIR=./
RESULTSDIR="${BASEDIR}tmp/results-benchmark-kieker-disk-1.8/"
SLEEPTIME=30 ## 30
NUM_LOOPS=10 ## 10
THREADS=1 ## 1
RECURSIONDEPTH=10 ## 10
TOTALCALLS=2000000 ## 2000000
METHODTIME=0 ## 0
MOREPARAMS="-r kieker.Logger"
#MOREPARAMS="-r kieker.Logger --quickstart"
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 "Removing and recreating '$RESULTSDIR'"
(rm -rf ${RESULTSDIR}) && mkdir ${RESULTSDIR}
mkdir ${RESULTSDIR}stat/
# Clear kieker.log and initialize logging
rm -f ${BASEDIR}kieker.log
touch ${BASEDIR}kieker.log
RAWFN="${RESULTSDIR}raw"
JAVAARGS="-server"
JAVAARGS="${JAVAARGS} -d64"
JAVAARGS="${JAVAARGS} -Xms1G -Xmx4G"
JAVAARGS="${JAVAARGS} -verbose:gc -XX:+PrintCompilation"
#JAVAARGS="${JAVAARGS} -XX:+PrintInlining"
#JAVAARGS="${JAVAARGS} -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation"
#JAVAARGS="${JAVAARGS} -Djava.compiler=NONE"
JAR="-jar dist/OverheadEvaluationMicrobenchmark.jar"
JAVAARGS_NOINSTR="${JAVAARGS}"
JAVAARGS_LTW="${JAVAARGS} -javaagent:${BASEDIR}lib/kieker-1.8_aspectj.jar -Dorg.aspectj.weaver.showWeaveInfo=false -Daj.weaving.verbose=false -Dkieker.monitoring.adaptiveMonitoring.enabled=false -Dorg.aspectj.weaver.loadtime.configuration=META-INF/kieker.aop.xml"
JAVAARGS_KIEKER_DEACTV="${JAVAARGS_LTW} -Dkieker.monitoring.enabled=false -Dkieker.monitoring.writer=kieker.monitoring.writer.DummyWriter"
JAVAARGS_KIEKER_NOLOGGING="${JAVAARGS_LTW} -Dkieker.monitoring.writer=kieker.monitoring.writer.DummyWriter"
JAVAARGS_KIEKER_LOGGING1="${JAVAARGS_LTW} -Dkieker.monitoring.writer=kieker.monitoring.writer.filesystem.AsyncFsWriter -Dkieker.monitoring.writer.filesystem.AsyncFsWriter.customStoragePath=${BASEDIR}tmp"
JAVAARGS_KIEKER_LOGGING2="${JAVAARGS_LTW} -Dkieker.monitoring.writer=kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter -Dkieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.customStoragePath=${BASEDIR}tmp"
## Write configuration
uname -a >${RESULTSDIR}configuration.txt
${JAVABIN}java ${JAVAARGS} -version 2>>${RESULTSDIR}configuration.txt
echo "JAVAARGS: ${JAVAARGS}" >>${RESULTSDIR}configuration.txt
echo "" >>${RESULTSDIR}configuration.txt
echo "Runtime: circa ${TIME} seconds" >>${RESULTSDIR}configuration.txt
echo "" >>${RESULTSDIR}configuration.txt
echo "SLEEPTIME=${SLEEPTIME}" >>${RESULTSDIR}configuration.txt
echo "NUM_LOOPS=${NUM_LOOPS}" >>${RESULTSDIR}configuration.txt
echo "TOTALCALLS=${TOTALCALLS}" >>${RESULTSDIR}configuration.txt
echo "METHODTIME=${METHODTIME}" >>${RESULTSDIR}configuration.txt
echo "THREADS=${THREADS}" >>${RESULTSDIR}configuration.txt
echo "RECURSIONDEPTH=${RECURSIONDEPTH}" >>${RESULTSDIR}configuration.txt
sync
## Execute Benchmark
for ((i=1;i<=${NUM_LOOPS};i+=1)); do
j=${RECURSIONDEPTH}
k=0
echo "## Starting iteration ${i}/${NUM_LOOPS}"
echo "## Starting iteration ${i}/${NUM_LOOPS}" >>${BASEDIR}kieker.log
# No instrumentation
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} No instrumentation"
echo " # ${i}.${j}.${k} No instrumentation" >>${BASEDIR}kieker.log
sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_NOINSTR} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--totalcalls ${TOTALCALLS} \
--methodtime ${METHODTIME} \
--totalthreads ${THREADS} \
--recursiondepth ${j} \
${MOREPARAMS}
kill %sar
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}kieker.log
echo >>${BASEDIR}kieker.log
sync
sleep ${SLEEPTIME}
# Deactivated probe
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} Deactivated probe"
echo " # ${i}.${j}.${k} Deactivated probe" >>${BASEDIR}kieker.log
sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_KIEKER_DEACTV} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--totalcalls ${TOTALCALLS} \
--methodtime ${METHODTIME} \
--totalthreads ${THREADS} \
--recursiondepth ${j} \
${MOREPARAMS}
kill %sar
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}kieker.log
echo >>${BASEDIR}kieker.log
sync
sleep ${SLEEPTIME}
# No logging
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} No logging (null writer)"
echo " # ${i}.${j}.${k} No logging (null writer)" >>${BASEDIR}kieker.log
sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_KIEKER_NOLOGGING} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--totalcalls ${TOTALCALLS} \
--methodtime ${METHODTIME} \
--totalthreads ${THREADS} \
--recursiondepth ${j} \
${MOREPARAMS}
kill %sar
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}kieker.log
echo >>${BASEDIR}kieker.log
sync
sleep ${SLEEPTIME}
# Logging 1
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} Logging 1"
echo " # ${i}.${j}.${k} Logging 1" >>${BASEDIR}kieker.log
sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING1} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--totalcalls ${TOTALCALLS} \
--methodtime ${METHODTIME} \
--totalthreads ${THREADS} \
--recursiondepth ${j} \
${MOREPARAMS}
kill %sar
rm -rf ${BASEDIR}tmp/kieker-*
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}kieker.log
echo >>${BASEDIR}kieker.log
sync
sleep ${SLEEPTIME}
# Logging 2
k=`expr ${k} + 1`
echo " # ${i}.${j}.${k} Logging 2"
echo " # ${i}.${j}.${k} Logging 2" >>${BASEDIR}kieker.log
sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 &
${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING2} ${JAR} \
--output-filename ${RAWFN}-${i}-${j}-${k}.csv \
--totalcalls ${TOTALCALLS} \
--methodtime ${METHODTIME} \
--totalthreads ${THREADS} \
--recursiondepth ${j} \
${MOREPARAMS}
kill %sar
rm -rf ${BASEDIR}tmp/kieker-*
[ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log
echo >>${BASEDIR}kieker.log
echo >>${BASEDIR}kieker.log
sync
sleep ${SLEEPTIME}
done
zip -jqr ${RESULTSDIR}stat.zip ${RESULTSDIR}stat
rm -rf ${RESULTSDIR}stat/
mv ${BASEDIR}kieker.log ${RESULTSDIR}kieker.log
[ -f ${RESULTSDIR}hotspot-1-${RECURSIONDEPTH}-1.log ] && grep "<task " ${RESULTSDIR}hotspot-*.log >${RESULTSDIR}log.log
[ -f ${BASEDIR}errorlog.txt ] && mv ${BASEDIR}errorlog.txt ${RESULTSDIR}
## Generate Results file
# Bars
R --vanilla --silent <<EOF
results_fn="${RAWFN}"
output_fn="${RESULTSDIR}results-bars.pdf"
outtxt_fn="${RESULTSDIR}results-text.txt"
configs.loop=${NUM_LOOPS}
configs.recursion=c(${RECURSIONDEPTH})
configs.labels=c("No Probe","Deactivated Probe","Collecting Data","Writer1","Writer2")
results.count=${TOTALCALLS}
results.skip=${TOTALCALLS}/2
bars.minval=(${METHODTIME}/1000)
bars.maxval=(${METHODTIME}/1000)+200
source("${RSCRIPTDIR}bar.r")
EOF
## Clean up raw results
zip -jqr ${RESULTSDIR}results.zip ${RAWFN}*
rm -f ${RAWFN}*
[ -f ${BASEDIR}nohup.out ] && mv ${BASEDIR}nohup.out ${RESULTSDIR}
File added
<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.aspectj.org/dtd/aspectj_1_5_0.dtd"> <!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.aspectj.org/dtd/aspectj_1_5_0.dtd">
<aspectj> <aspectj>
<weaver options=""> <weaver options="">
<include within="kieker.evaluation.monitoredApplication.MonitoredClass"/> <include within="mooBench.monitoredApplication.MonitoredClass"/>
</weaver> </weaver>
<aspects> <aspects>
<aspect name="kieker.monitoring.probe.aspectj.flow.constructorExecution.FullInstrumentation" />
<aspect name="kieker.monitoring.probe.aspectj.flow.operationExecution.FullInstrumentation" /> <aspect name="kieker.monitoring.probe.aspectj.flow.operationExecution.FullInstrumentation" />
</aspects> </aspects>
</aspectj> </aspectj>
kieker.monitoring.enabled=true kieker.monitoring.enabled=true
kieker.monitoring.name=KIEKER-BENCHMARK kieker.monitoring.name=KIEKER-BENCHMARK
kieker.monitoring.adaptiveMonitoring.enabled=true
kieker.monitoring.adaptiveMonitoring.readInterval=0 kieker.monitoring.adaptiveMonitoring.enabled=false
kieker.monitoring.adaptiveMonitoring.configFile=META-INF/kieker.monitoring.adaptiveMonitoring.conf kieker.monitoring.periodicSensorsExecutorPoolSize=0
kieker.monitoring.writer.AsyncDummyWriter.QueueSize=100000 kieker.monitoring.writer.AsyncDummyWriter.QueueSize=100000
kieker.monitoring.writer.AsyncDummyWriter.QueueFullBehavior=1
kieker.monitoring.writer.filesystem.SyncFsWriter.bufferSize=16777216
kieker.monitoring.writer.filesystem.SyncFsWriter.flush=false
kieker.monitoring.writer.filesystem.AsyncFsWriter.QueueSize=100000 kieker.monitoring.writer.filesystem.AsyncFsWriter.QueueSize=100000
kieker.monitoring.writer.filesystem.AsyncFsWriter.QueueFullBehavior=1
kieker.monitoring.writer.filesystem.AsyncFsWriter.bufferSize=16777216 kieker.monitoring.writer.filesystem.AsyncFsWriter.bufferSize=16777216
kieker.monitoring.writer.filesystem.AsyncFsWriter.flush=false kieker.monitoring.writer.filesystem.AsyncFsWriter.flush=false
kieker.monitoring.writer.filesystem.SyncFsWriter.QueueSize=100000
kieker.monitoring.writer.filesystem.SyncFsWriter.bufferSize=16777216
kieker.monitoring.writer.filesystem.SyncFsWriter.flush=false
kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.QueueSize=100000 kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.QueueSize=100000
kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.QueueFullBehavior=1
kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.bufferSize=16777216 kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.bufferSize=16777216
kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.storeInJavaIoTmpdir=false
kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.QueueSize=100000 kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.QueueSize=100000
kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.QueueFullBehavior=1
kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.bufferSize=16777216 kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.bufferSize=16777216
kieker.monitoring.writer.tcp.TCPWriter.QueueFullBehavior=1
kieker.monitoring.writer.tcp.TCPWriter.QueueSize=100000
/***************************************************************************
* Copyright 2013 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker;
import java.io.IOException;
import mooBench.benchmark.Benchmark;
/**
* @author Jan Waller
*/
public class Logger implements Runnable {
public void run() {
try {
java.util.logging.LogManager.getLogManager().readConfiguration(
Benchmark.class.getClassLoader().getResourceAsStream("META-INF/kieker.logging.properties"));
} catch (final IOException ex) {
java.util.logging.Logger.getAnonymousLogger().log(java.util.logging.Level.SEVERE, "Could not load default logging.properties file", ex);
}
}
}
/***************************************************************************
* Copyright 2013 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.tcp;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import kieker.analysis.AnalysisController;
import kieker.analysis.IAnalysisController;
import kieker.analysis.IProjectContext;
import kieker.analysis.exception.AnalysisConfigurationException;
import kieker.analysis.plugin.annotation.OutputPort;
import kieker.analysis.plugin.annotation.Plugin;
import kieker.analysis.plugin.annotation.Property;
import kieker.analysis.plugin.reader.AbstractReaderPlugin;
import kieker.common.configuration.Configuration;
import kieker.common.exception.MonitoringRecordException;
import kieker.common.logging.Log;
import kieker.common.logging.LogFactory;
import kieker.common.record.AbstractMonitoringRecord;
import kieker.common.record.IMonitoringRecord;
import kieker.common.record.misc.RegistryRecord;
import kieker.common.util.registry.ILookup;
import kieker.common.util.registry.Lookup;
// Command-Line:
// java -javaagent:lib/kieker-1.8-SNAPSHOT_aspectj.jar -Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.TCPWriter -Dkieker.monitoring.writer.tcp.TCPWriter.QueueFullBehavior=1 -jar dist\OverheadEvaluationMicrobenchmark.jar --recursiondepth 10 --totalthreads 1 --methodtime 0 --output-filename raw.csv --totalcalls 10000000
/**
*
* @author Jan Waller
*
* @since 1.8
*/
public final class TestExperiment1 {
private static final Log LOG = LogFactory.getLog(TestExperiment1.class);
private TestExperiment1() {}
public static void main(final String[] args) {
final IAnalysisController analysisController = new AnalysisController("TCPThroughput");
TestExperiment1.createAndConnectPlugins(analysisController);
try {
analysisController.run();
} catch (final AnalysisConfigurationException ex) {
TestExperiment1.LOG.error("Failed to start the example project.", ex);
}
}
private static void createAndConnectPlugins(final IAnalysisController analysisController) {
final Configuration readerConfig = new Configuration();
// readerConfig.setProperty(TCPReader.CONFIG_PROPERTY_NAME_PORT1, 10333);
// readerConfig.setProperty(TCPReader.CONFIG_PROPERTY_NAME_PORT2, 10334);
final TCPCountingReader reader = new TCPCountingReader(readerConfig, analysisController);
reader.getName(); // to remove unused warning
}
}
/**
*
* @author Jan Waller
*
* @since 1.8
*/
@Plugin(description = "A reader which reads records from a TCP port",
outputPorts = {
@OutputPort(name = TCPCountingReader.OUTPUT_PORT_NAME_RECORDS, eventTypes = { IMonitoringRecord.class }, description = "Output Port of the TCPReader")
},
configuration = {
@Property(name = TCPCountingReader.CONFIG_PROPERTY_NAME_PORT1, defaultValue = "10133",
description = "The first port of the server used for the TCP connection."),
@Property(name = TCPCountingReader.CONFIG_PROPERTY_NAME_PORT2, defaultValue = "10134",
description = "The second port of the server used for the TCP connection.")
})
final class TCPCountingReader extends AbstractReaderPlugin {
/** The name of the output port delivering the received records. */
public static final String OUTPUT_PORT_NAME_RECORDS = "monitoringRecords";
/** The name of the configuration determining the TCP port. */
public static final String CONFIG_PROPERTY_NAME_PORT1 = "port1";
/** The name of the configuration determining the TCP port. */
public static final String CONFIG_PROPERTY_NAME_PORT2 = "port2";
private static final int MESSAGE_BUFFER_SIZE = 65535;
static final Log LOG = LogFactory.getLog(TCPCountingReader.class);
private final int port1;
private final int port2;
private final ILookup<String> stringRegistry = new Lookup<String>();
final AtomicInteger counter = new AtomicInteger(0);
public TCPCountingReader(final Configuration configuration, final IProjectContext projectContext) {
super(configuration, projectContext);
this.port1 = this.configuration.getIntProperty(CONFIG_PROPERTY_NAME_PORT1);
this.port2 = this.configuration.getIntProperty(CONFIG_PROPERTY_NAME_PORT2);
}
@Override
public boolean init() {
final ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1);
executorService.scheduleAtFixedRate(new Runnable() {
public void run() {
LOG.info("Records/s: " + TCPCountingReader.this.counter.getAndSet(0));
}
}, 0, 1, TimeUnit.SECONDS);
final TCPStringReader tcpStringReader = new TCPStringReader(this.port2, this.stringRegistry);
tcpStringReader.start();
return super.init();
}
@Override
public Configuration getCurrentConfiguration() {
final Configuration configuration = new Configuration();
configuration.setProperty(CONFIG_PROPERTY_NAME_PORT1, Integer.toString(this.port1));
configuration.setProperty(CONFIG_PROPERTY_NAME_PORT2, Integer.toString(this.port2));
return configuration;
}
public boolean read() {
ServerSocketChannel serversocket = null;
try {
serversocket = ServerSocketChannel.open();
serversocket.socket().bind(new InetSocketAddress(this.port1));
if (LOG.isDebugEnabled()) {
LOG.debug("Listening on port " + this.port1);
}
// BEGIN also loop this one?
final SocketChannel socketChannel = serversocket.accept();
final ByteBuffer buffer = ByteBuffer.allocateDirect(MESSAGE_BUFFER_SIZE);
while (socketChannel.read(buffer) != -1) {
buffer.flip();
// System.out.println("Reading, remaining:" + buffer.remaining());
try {
while (buffer.hasRemaining()) {
buffer.mark();
final int clazzid = buffer.getInt();
final long loggingTimestamp = buffer.getLong();
final IMonitoringRecord record;
try { // NOCS (Nested try-catch)
record = AbstractMonitoringRecord.createFromByteBuffer(clazzid, buffer, this.stringRegistry);
record.setLoggingTimestamp(loggingTimestamp);
// super.deliver(OUTPUT_PORT_NAME_RECORDS, record);
this.counter.incrementAndGet();
} catch (final MonitoringRecordException ex) {
LOG.error("Failed to create record.", ex);
}
}
buffer.clear();
} catch (final BufferUnderflowException ex) {
buffer.reset();
// System.out.println("Underflow, remaining:" + buffer.remaining());
buffer.compact();
}
}
// System.out.println("Channel closing...");
socketChannel.close();
// END also loop this one?
} catch (final IOException ex) {
LOG.error("Error while reading", ex);
return false;
} finally {
if (null != serversocket) {
try {
serversocket.close();
} catch (final IOException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Failed to close TCP connection!", e);
}
}
}
}
return true;
}
public void terminate(final boolean error) {
LOG.info("Shutdown of TCPReader requested.");
}
}
/**
*
* @author Jan Waller
*
* @since 1.8
*/
class TCPStringReader extends Thread {
private static final int MESSAGE_BUFFER_SIZE = 65535;
private static final Log LOG = LogFactory.getLog(TCPStringReader.class);
private final int port;
private final ILookup<String> stringRegistry;
public TCPStringReader(final int port, final ILookup<String> stringRegistry) {
this.port = port;
this.stringRegistry = stringRegistry;
}
@Override
public void run() {
ServerSocketChannel serversocket = null;
try {
serversocket = ServerSocketChannel.open();
serversocket.socket().bind(new InetSocketAddress(this.port));
if (LOG.isDebugEnabled()) {
LOG.debug("Listening on port " + this.port);
}
// BEGIN also loop this one?
final SocketChannel socketChannel = serversocket.accept();
final ByteBuffer buffer = ByteBuffer.allocateDirect(MESSAGE_BUFFER_SIZE);
while (socketChannel.read(buffer) != -1) {
buffer.flip();
try {
while (buffer.hasRemaining()) {
buffer.mark();
RegistryRecord.registerRecordInRegistry(buffer, this.stringRegistry);
}
buffer.clear();
} catch (final BufferUnderflowException ex) {
buffer.reset();
buffer.compact();
}
}
socketChannel.close();
// END also loop this one?
} catch (final IOException ex) {
LOG.error("Error while reading", ex);
} finally {
if (null != serversocket) {
try {
serversocket.close();
} catch (final IOException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Failed to close TCP connection!", e);
}
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment