diff --git a/.classpath b/.classpath index 470d2dbc659b9909dc5b403485e90bcb628feb93..7ed6e8b9afcdbeb85ac36c9d50996a594b010866 100644 --- a/.classpath +++ b/.classpath @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="frameworks/Kieker/src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> - <classpathentry combineaccessrules="false" kind="src" path="/Kieker"/> <classpathentry kind="lib" path="lib/commons-cli-1.2.jar"/> + <classpathentry combineaccessrules="false" kind="src" path="/Kieker"/> <classpathentry kind="output" path="build-eclipse"/> </classpath> diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs index 86292875eeeb66fd217829241eebf20e0816715f..2c9a6e2f077b9657836e54c02783c5cc3b54d9d0 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -56,7 +56,7 @@ editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_Kieker - Profile formatter_settings_version=12 org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;junit;org;com;kieker;kieker.test; +org.eclipse.jdt.ui.importorder=java;javax;junit;org;com;mooBench;kieker;kieker.test; org.eclipse.jdt.ui.ondemandthreshold=99 org.eclipse.jdt.ui.staticondemandthreshold=99 sp_cleanup.add_default_serial_version_id=true diff --git a/bin/r-scripts/benchmark-manual-configurations.r b/bin/2012-msept/r-scripts/benchmark-manual-configurations.r similarity index 100% rename from bin/r-scripts/benchmark-manual-configurations.r rename to bin/2012-msept/r-scripts/benchmark-manual-configurations.r diff --git a/bin/r-scripts/benchmark-manual-hardware.r b/bin/2012-msept/r-scripts/benchmark-manual-hardware.r similarity index 100% rename from bin/r-scripts/benchmark-manual-hardware.r rename to bin/2012-msept/r-scripts/benchmark-manual-hardware.r diff --git a/bin/r-scripts/benchmark-manual-linear.r b/bin/2012-msept/r-scripts/benchmark-manual-linear.r similarity index 100% rename from bin/r-scripts/benchmark-manual-linear.r rename to bin/2012-msept/r-scripts/benchmark-manual-linear.r diff --git a/bin/r-scripts/benchmark-manual-singlethreaded.r b/bin/2012-msept/r-scripts/benchmark-manual-singlethreaded.r similarity index 100% rename from bin/r-scripts/benchmark-manual-singlethreaded.r rename to bin/2012-msept/r-scripts/benchmark-manual-singlethreaded.r diff --git a/bin/r-scripts/benchmark-manual-threaded.r b/bin/2012-msept/r-scripts/benchmark-manual-threaded.r similarity index 100% rename from bin/r-scripts/benchmark-manual-threaded.r rename to bin/2012-msept/r-scripts/benchmark-manual-threaded.r diff --git a/bin/r-scripts/benchmark-recursive-jmx.r b/bin/2012-msept/r-scripts/benchmark-recursive-jmx.r similarity index 100% rename from bin/r-scripts/benchmark-recursive-jmx.r rename to bin/2012-msept/r-scripts/benchmark-recursive-jmx.r diff --git a/bin/r-scripts/benchmark-recursive-onlyWriter.r b/bin/2012-msept/r-scripts/benchmark-recursive-onlyWriter.r similarity index 100% rename from bin/r-scripts/benchmark-recursive-onlyWriter.r rename to bin/2012-msept/r-scripts/benchmark-recursive-onlyWriter.r diff --git a/bin/r-scripts/benchmark-recursive.r b/bin/2012-msept/r-scripts/benchmark-recursive.r similarity index 100% rename from bin/r-scripts/benchmark-recursive.r rename to bin/2012-msept/r-scripts/benchmark-recursive.r diff --git a/bin/r-scripts/time-series-average.r b/bin/2012-msept/r-scripts/time-series-average.r similarity index 100% rename from bin/r-scripts/time-series-average.r rename to bin/2012-msept/r-scripts/time-series-average.r diff --git a/bin/r-scripts/time-series-jmx-average.r b/bin/2012-msept/r-scripts/time-series-jmx-average.r similarity index 100% rename from bin/r-scripts/time-series-jmx-average.r rename to bin/2012-msept/r-scripts/time-series-jmx-average.r diff --git a/bin/r-scripts/time-series-jmx.r b/bin/2012-msept/r-scripts/time-series-jmx.r similarity index 100% rename from bin/r-scripts/time-series-jmx.r rename to bin/2012-msept/r-scripts/time-series-jmx.r diff --git a/bin/r-scripts/time-series.r b/bin/2012-msept/r-scripts/time-series.r similarity index 100% rename from bin/r-scripts/time-series.r rename to bin/2012-msept/r-scripts/time-series.r diff --git a/bin/run-benchmark-cycle-async.sh b/bin/2012-msept/run-benchmark-cycle-async.sh similarity index 100% rename from bin/run-benchmark-cycle-async.sh rename to bin/2012-msept/run-benchmark-cycle-async.sh diff --git a/bin/run-benchmark-cycle-sync.sh b/bin/2012-msept/run-benchmark-cycle-sync.sh similarity index 100% rename from bin/run-benchmark-cycle-sync.sh rename to bin/2012-msept/run-benchmark-cycle-sync.sh diff --git a/bin/run-benchmark-recursive-jmx.sh b/bin/2012-msept/run-benchmark-recursive-jmx.sh similarity index 100% rename from bin/run-benchmark-recursive-jmx.sh rename to bin/2012-msept/run-benchmark-recursive-jmx.sh diff --git a/bin/run-benchmark-recursive-linear.sh b/bin/2012-msept/run-benchmark-recursive-linear.sh similarity index 100% rename from bin/run-benchmark-recursive-linear.sh rename to bin/2012-msept/run-benchmark-recursive-linear.sh diff --git a/bin/run-benchmark-recursive.sh b/bin/2012-msept/run-benchmark-recursive.sh similarity index 100% rename from bin/run-benchmark-recursive.sh rename to bin/2012-msept/run-benchmark-recursive.sh diff --git a/bin/run-cycle-experiment-singlethreaded.sh b/bin/2012-msept/run-cycle-experiment-singlethreaded.sh similarity index 100% rename from bin/run-cycle-experiment-singlethreaded.sh rename to bin/2012-msept/run-cycle-experiment-singlethreaded.sh diff --git a/bin/run-cycle.sh b/bin/2012-msept/run-cycle.sh similarity index 100% rename from bin/run-cycle.sh rename to bin/2012-msept/run-cycle.sh diff --git a/bin/icpe/benchmark-disk-writer-slow.sh b/bin/2014-icpe/benchmark-disk-writer-slow.sh similarity index 100% rename from bin/icpe/benchmark-disk-writer-slow.sh rename to bin/2014-icpe/benchmark-disk-writer-slow.sh diff --git a/bin/icpe/benchmark-disk-writer.sh b/bin/2014-icpe/benchmark-disk-writer.sh similarity index 100% rename from bin/icpe/benchmark-disk-writer.sh rename to bin/2014-icpe/benchmark-disk-writer.sh diff --git a/bin/icpe/benchmark-tcp-ffi.sh b/bin/2014-icpe/benchmark-tcp-ffi.sh similarity index 100% rename from bin/icpe/benchmark-tcp-ffi.sh rename to bin/2014-icpe/benchmark-tcp-ffi.sh diff --git a/bin/icpe/benchmark-tcp-kieker.sh b/bin/2014-icpe/benchmark-tcp-kieker.sh similarity index 100% rename from bin/icpe/benchmark-tcp-kieker.sh rename to bin/2014-icpe/benchmark-tcp-kieker.sh diff --git a/bin/icpe/r/bar.r b/bin/2014-icpe/r/bar.r similarity index 100% rename from bin/icpe/r/bar.r rename to bin/2014-icpe/r/bar.r diff --git a/bin/icpe/r/throughput-average.r b/bin/2014-icpe/r/throughput-average.r similarity index 100% rename from bin/icpe/r/throughput-average.r rename to bin/2014-icpe/r/throughput-average.r diff --git a/bin/icpe/r/throughput.r b/bin/2014-icpe/r/throughput.r similarity index 100% rename from bin/icpe/r/throughput.r rename to bin/2014-icpe/r/throughput.r diff --git a/bin/icpe/r/timeseries-average.r b/bin/2014-icpe/r/timeseries-average.r similarity index 100% rename from bin/icpe/r/timeseries-average.r rename to bin/2014-icpe/r/timeseries-average.r diff --git a/bin/icpe/r/timeseries.r b/bin/2014-icpe/r/timeseries.r similarity index 100% rename from bin/icpe/r/timeseries.r rename to bin/2014-icpe/r/timeseries.r diff --git a/bin/r/stats.r b/bin/r/stats.r new file mode 100644 index 0000000000000000000000000000000000000000..a40883e76535be0cd7bb615f5c9d20d2dc3c9537 --- /dev/null +++ b/bin/r/stats.r @@ -0,0 +1,74 @@ +#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) +} diff --git a/build.xml b/build.xml index 4a4eef6fd57d546d0714380061f93b3f0b9488f0..559fe880956dea9de4455ec689b83cf04c19b156 100644 --- a/build.xml +++ b/build.xml @@ -14,12 +14,19 @@ <path id="compile-classpath"> <fileset dir="lib/"> <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> </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"> <fileset dir="src/META-INF" /> + <fileset dir="frameworks/Kieker/src/META-INF" /> </copy> </target> @@ -28,6 +35,7 @@ <classpath> <fileset dir="lib/"> <include name="**/*.jar" /> + <exclude name="commons-cli-*.jar" /> </fileset> </classpath> </manifestclasspath> @@ -35,9 +43,10 @@ <fileset dir="build" /> <fileset dir="." includes="LICENSE README" /> <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}" /> </manifest> + <zipfileset src="lib/commons-cli-1.2.jar" /> </jar> </target> diff --git a/frameworks/Kieker/LICENSE b/frameworks/Kieker/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/frameworks/Kieker/LICENSE @@ -0,0 +1,202 @@ + + 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. diff --git a/frameworks/Kieker/benchmark-disk-writer-1.8.sh b/frameworks/Kieker/benchmark-disk-writer-1.8.sh new file mode 100644 index 0000000000000000000000000000000000000000..029049bba191870eed04d24149a6b75652b99397 --- /dev/null +++ b/frameworks/Kieker/benchmark-disk-writer-1.8.sh @@ -0,0 +1,193 @@ +#!/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} diff --git a/frameworks/Kieker/lib/kieker-1.8_aspectj.jar b/frameworks/Kieker/lib/kieker-1.8_aspectj.jar new file mode 100644 index 0000000000000000000000000000000000000000..fc03a3204fb9f6a1e27b64190e19957c6b8578c9 Binary files /dev/null and b/frameworks/Kieker/lib/kieker-1.8_aspectj.jar differ diff --git a/src/META-INF/kieker.aop.xml b/frameworks/Kieker/src/META-INF/kieker.aop.xml similarity index 60% rename from src/META-INF/kieker.aop.xml rename to frameworks/Kieker/src/META-INF/kieker.aop.xml index 623458731d8c7b6d21f7240ff36d70b860f0f57a..6653db0ad25cf4215718df16889ff27c14df5e72 100644 --- a/src/META-INF/kieker.aop.xml +++ b/frameworks/Kieker/src/META-INF/kieker.aop.xml @@ -1,10 +1,9 @@ <!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.aspectj.org/dtd/aspectj_1_5_0.dtd"> <aspectj> <weaver options=""> - <include within="kieker.evaluation.monitoredApplication.MonitoredClass"/> + <include within="mooBench.monitoredApplication.MonitoredClass"/> </weaver> <aspects> - <aspect name="kieker.monitoring.probe.aspectj.flow.constructorExecution.FullInstrumentation" /> <aspect name="kieker.monitoring.probe.aspectj.flow.operationExecution.FullInstrumentation" /> </aspects> </aspectj> diff --git a/src/META-INF/logging.properties b/frameworks/Kieker/src/META-INF/kieker.logging.properties similarity index 100% rename from src/META-INF/logging.properties rename to frameworks/Kieker/src/META-INF/kieker.logging.properties diff --git a/src/META-INF/kieker.monitoring.properties b/frameworks/Kieker/src/META-INF/kieker.monitoring.properties similarity index 60% rename from src/META-INF/kieker.monitoring.properties rename to frameworks/Kieker/src/META-INF/kieker.monitoring.properties index 98fbc40459c65fe542e405a436cc9431fbc54bfb..86af7e2c5aaa651378383fa87f937a8fc18693a1 100644 --- a/src/META-INF/kieker.monitoring.properties +++ b/frameworks/Kieker/src/META-INF/kieker.monitoring.properties @@ -1,22 +1,27 @@ kieker.monitoring.enabled=true kieker.monitoring.name=KIEKER-BENCHMARK -kieker.monitoring.adaptiveMonitoring.enabled=true -kieker.monitoring.adaptiveMonitoring.readInterval=0 -kieker.monitoring.adaptiveMonitoring.configFile=META-INF/kieker.monitoring.adaptiveMonitoring.conf + +kieker.monitoring.adaptiveMonitoring.enabled=false +kieker.monitoring.periodicSensorsExecutorPoolSize=0 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.QueueFullBehavior=1 kieker.monitoring.writer.filesystem.AsyncFsWriter.bufferSize=16777216 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.QueueFullBehavior=1 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.QueueFullBehavior=1 kieker.monitoring.writer.filesystem.AsyncBinaryZipWriter.bufferSize=16777216 + +kieker.monitoring.writer.tcp.TCPWriter.QueueFullBehavior=1 +kieker.monitoring.writer.tcp.TCPWriter.QueueSize=100000 diff --git a/frameworks/Kieker/src/kieker/Logger.java b/frameworks/Kieker/src/kieker/Logger.java new file mode 100644 index 0000000000000000000000000000000000000000..da3b1daafd06b42390c8124ed06bbc3dc4a7fd41 --- /dev/null +++ b/frameworks/Kieker/src/kieker/Logger.java @@ -0,0 +1,36 @@ +/*************************************************************************** + * 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); + } + } +} diff --git a/frameworks/Kieker/src/kieker/tcp/TestExperiment1.java b/frameworks/Kieker/src/kieker/tcp/TestExperiment1.java new file mode 100644 index 0000000000000000000000000000000000000000..fa1a2ed17151404d512eae4644a1eba1e277e9b2 --- /dev/null +++ b/frameworks/Kieker/src/kieker/tcp/TestExperiment1.java @@ -0,0 +1,267 @@ +/*************************************************************************** + * 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); + } + } + } + } + } + +} diff --git a/frameworks/Kieker/src/kieker/tcp/TestExperiment2.java b/frameworks/Kieker/src/kieker/tcp/TestExperiment2.java new file mode 100644 index 0000000000000000000000000000000000000000..803dbf3334afd42be8d157dd0e4328cd2e9581b4 --- /dev/null +++ b/frameworks/Kieker/src/kieker/tcp/TestExperiment2.java @@ -0,0 +1,86 @@ +/*************************************************************************** + * 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.util.concurrent.TimeUnit; + +import kieker.analysis.AnalysisController; +import kieker.analysis.IAnalysisController; +import kieker.analysis.exception.AnalysisConfigurationException; +import kieker.analysis.plugin.filter.flow.EventRecordTraceReconstructionFilter; +import kieker.analysis.plugin.filter.forward.AnalysisThroughputFilter; +import kieker.analysis.plugin.filter.forward.TeeFilter; +import kieker.analysis.plugin.reader.tcp.TCPReader; +import kieker.analysis.plugin.reader.timer.TimeReader; +import kieker.common.configuration.Configuration; +import kieker.common.logging.Log; +import kieker.common.logging.LogFactory; + +// 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 TestExperiment2 { + private static final Log LOG = LogFactory.getLog(TestExperiment2.class); + + private TestExperiment2() {} + + public static void main(final String[] args) throws IllegalStateException, AnalysisConfigurationException { + final IAnalysisController analysisController = new AnalysisController("TCPThroughput"); + TestExperiment2.createAndConnectPlugins(analysisController); + try { + analysisController.run(); + } catch (final AnalysisConfigurationException ex) { + TestExperiment2.LOG.error("Failed to start the example project.", ex); + } + } + + private static void createAndConnectPlugins(final IAnalysisController analysisController) throws IllegalStateException, AnalysisConfigurationException { + final Configuration readerConfig = new Configuration(); + // readerConfig.setProperty(TCPReader.CONFIG_PROPERTY_NAME_PORT1, 10333); + // readerConfig.setProperty(TCPReader.CONFIG_PROPERTY_NAME_PORT2, 10334); + final TCPReader reader = new TCPReader(readerConfig, analysisController); + + final Configuration timeConfig = new Configuration(); + final TimeReader timeReader = new TimeReader(timeConfig, analysisController); + + final Configuration configTraceRecon = new Configuration(); + configTraceRecon.setProperty(EventRecordTraceReconstructionFilter.CONFIG_PROPERTY_NAME_TIMEUNIT, TimeUnit.SECONDS.name()); + configTraceRecon.setProperty(EventRecordTraceReconstructionFilter.CONFIG_PROPERTY_NAME_MAX_TRACE_DURATION, "1"); + configTraceRecon.setProperty(EventRecordTraceReconstructionFilter.CONFIG_PROPERTY_NAME_MAX_TRACE_TIMEOUT, "1"); + final EventRecordTraceReconstructionFilter traceRecon = new EventRecordTraceReconstructionFilter(configTraceRecon, analysisController); + + analysisController.connect(reader, TCPReader.OUTPUT_PORT_NAME_RECORDS, traceRecon, EventRecordTraceReconstructionFilter.INPUT_PORT_NAME_TRACE_RECORDS); + analysisController.connect(timeReader, TimeReader.OUTPUT_PORT_NAME_TIMESTAMPS, traceRecon, EventRecordTraceReconstructionFilter.INPUT_PORT_NAME_TIME_EVENT); + + final Configuration counterConfig = new Configuration(); + final AnalysisThroughputFilter through = new AnalysisThroughputFilter(counterConfig, analysisController); + analysisController.connect(traceRecon, EventRecordTraceReconstructionFilter.OUTPUT_PORT_NAME_TRACE_VALID, through, + AnalysisThroughputFilter.INPUT_PORT_NAME_OBJECTS); + analysisController.connect(timeReader, TimeReader.OUTPUT_PORT_NAME_TIMESTAMPS, through, AnalysisThroughputFilter.INPUT_PORT_NAME_TIME); + + final Configuration confTeeFilter = new Configuration(); + confTeeFilter.setProperty(TeeFilter.CONFIG_PROPERTY_NAME_STREAM, TeeFilter.CONFIG_PROPERTY_VALUE_STREAM_STDOUT); + // confTeeFilter.setProperty(TeeFilter.CONFIG_PROPERTY_NAME_STREAM, TeeFilter.CONFIG_PROPERTY_VALUE_STREAM_NULL); + final TeeFilter teeFilter = new TeeFilter(confTeeFilter, analysisController); + analysisController.connect(through, AnalysisThroughputFilter.OUTPUT_PORT_NAME_THROUGHPUT, teeFilter, TeeFilter.INPUT_PORT_NAME_EVENTS); + } +} diff --git a/frameworks/Kieker/src/kieker/tcp/TestExperiment3.java b/frameworks/Kieker/src/kieker/tcp/TestExperiment3.java new file mode 100644 index 0000000000000000000000000000000000000000..ddac5da67418fb29617988863f9c16310deadb9c --- /dev/null +++ b/frameworks/Kieker/src/kieker/tcp/TestExperiment3.java @@ -0,0 +1,89 @@ +/*************************************************************************** + * 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.util.concurrent.TimeUnit; + +import kieker.analysis.AnalysisController; +import kieker.analysis.IAnalysisController; +import kieker.analysis.exception.AnalysisConfigurationException; +import kieker.analysis.plugin.filter.flow.EventRecordTraceReconstructionFilter; +import kieker.analysis.plugin.filter.flow.TraceAggregationFilter; +import kieker.analysis.plugin.filter.forward.TeeFilter; +import kieker.analysis.plugin.reader.tcp.TCPReader; +import kieker.analysis.plugin.reader.timer.TimeReader; +import kieker.common.configuration.Configuration; +import kieker.common.logging.Log; +import kieker.common.logging.LogFactory; + +// 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 TestExperiment3 { + private static final Log LOG = LogFactory.getLog(TestExperiment3.class); + + private TestExperiment3() {} + + public static void main(final String[] args) throws IllegalStateException, AnalysisConfigurationException { + final IAnalysisController analysisController = new AnalysisController("TCPThroughput"); + TestExperiment3.createAndConnectPlugins(analysisController); + try { + analysisController.run(); + } catch (final AnalysisConfigurationException ex) { + TestExperiment3.LOG.error("Failed to start the example project.", ex); + } + } + + private static void createAndConnectPlugins(final IAnalysisController analysisController) throws IllegalStateException, AnalysisConfigurationException { + final Configuration readerConfig = new Configuration(); + // readerConfig.setProperty(TCPReader.CONFIG_PROPERTY_NAME_PORT1, 10333); + // readerConfig.setProperty(TCPReader.CONFIG_PROPERTY_NAME_PORT2, 10334); + final TCPReader reader = new TCPReader(readerConfig, analysisController); + + final Configuration timeConfig = new Configuration(); + final TimeReader timeReader = new TimeReader(timeConfig, analysisController); + + final Configuration configTraceRecon = new Configuration(); + configTraceRecon.setProperty(EventRecordTraceReconstructionFilter.CONFIG_PROPERTY_NAME_TIMEUNIT, TimeUnit.SECONDS.name()); + configTraceRecon.setProperty(EventRecordTraceReconstructionFilter.CONFIG_PROPERTY_NAME_MAX_TRACE_DURATION, "1"); + configTraceRecon.setProperty(EventRecordTraceReconstructionFilter.CONFIG_PROPERTY_NAME_MAX_TRACE_TIMEOUT, "1"); + final EventRecordTraceReconstructionFilter traceRecon = new EventRecordTraceReconstructionFilter(configTraceRecon, analysisController); + + analysisController.connect(reader, TCPReader.OUTPUT_PORT_NAME_RECORDS, traceRecon, EventRecordTraceReconstructionFilter.INPUT_PORT_NAME_TRACE_RECORDS); + analysisController.connect(timeReader, TimeReader.OUTPUT_PORT_NAME_TIMESTAMPS, traceRecon, EventRecordTraceReconstructionFilter.INPUT_PORT_NAME_TIME_EVENT); + + final Configuration configTraceAggr = new Configuration(); + configTraceAggr.setProperty(TraceAggregationFilter.CONFIG_PROPERTY_NAME_TIMEUNIT, TimeUnit.SECONDS.name()); + configTraceAggr.setProperty(TraceAggregationFilter.CONFIG_PROPERTY_NAME_MAX_COLLECTION_DURATION, "1"); + final TraceAggregationFilter traceAggr = new TraceAggregationFilter(configTraceAggr, analysisController); + + analysisController.connect(traceRecon, EventRecordTraceReconstructionFilter.OUTPUT_PORT_NAME_TRACE_VALID, traceAggr, + TraceAggregationFilter.INPUT_PORT_NAME_TRACES); + analysisController.connect(timeReader, TimeReader.OUTPUT_PORT_NAME_TIMESTAMPS, traceAggr, TraceAggregationFilter.INPUT_PORT_NAME_TIME_EVENT); + + final Configuration confTeeFilter = new Configuration(); + confTeeFilter.setProperty(TeeFilter.CONFIG_PROPERTY_NAME_STREAM, TeeFilter.CONFIG_PROPERTY_VALUE_STREAM_STDOUT); + // confTeeFilter.setProperty(TeeFilter.CONFIG_PROPERTY_NAME_STREAM, TeeFilter.CONFIG_PROPERTY_VALUE_STREAM_NULL); + final TeeFilter teeFilter = new TeeFilter(confTeeFilter, analysisController); + analysisController.connect(traceAggr, TraceAggregationFilter.OUTPUT_PORT_NAME_TRACES, teeFilter, TeeFilter.INPUT_PORT_NAME_EVENTS); + } +} diff --git a/src/META-INF/.gitignore b/src/META-INF/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5e7d2734cfc60289debf74293817c0a8f572ff32 --- /dev/null +++ b/src/META-INF/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/src/META-INF/kieker.monitoring.adaptiveMonitoring.conf b/src/META-INF/kieker.monitoring.adaptiveMonitoring.conf deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/META-INF/kieker.monitoring.adaptiveMonitoring.disabled.conf b/src/META-INF/kieker.monitoring.adaptiveMonitoring.disabled.conf deleted file mode 100644 index e0c87fe3d9b3ec52117c8fbf768dcc3e8ffc45d4..0000000000000000000000000000000000000000 --- a/src/META-INF/kieker.monitoring.adaptiveMonitoring.disabled.conf +++ /dev/null @@ -1 +0,0 @@ -- long kieker.evaluation.monitoredApplication.MonitoredClass.monitoredMethod(..) diff --git a/src/kieker/evaluation/benchmark/Benchmark.java b/src/mooBench/benchmark/Benchmark.java similarity index 89% rename from src/kieker/evaluation/benchmark/Benchmark.java rename to src/mooBench/benchmark/Benchmark.java index 4f1ba539677360e0d6169996013d31138bb251ad..d6e04669b22d6a3037909f92089041a996735423 100644 --- a/src/kieker/evaluation/benchmark/Benchmark.java +++ b/src/mooBench/benchmark/Benchmark.java @@ -14,11 +14,10 @@ * limitations under the License. ***************************************************************************/ -package kieker.evaluation.benchmark; +package mooBench.benchmark; import java.io.BufferedOutputStream; import java.io.FileOutputStream; -import java.io.IOException; import java.io.PrintStream; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -30,7 +29,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; -import kieker.evaluation.monitoredApplication.MonitoredClass; +import mooBench.monitoredApplication.MonitoredClass; /** * @author Jan Waller @@ -46,14 +45,6 @@ public final class Benchmark { private static int recursionDepth = 0; private static boolean quickstart = false; - static { - try { - java.util.logging.LogManager.getLogManager().readConfiguration(Benchmark.class.getClassLoader().getResourceAsStream("META-INF/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); - } - } - private Benchmark() {} public static void main(final String[] args) throws InterruptedException { @@ -95,7 +86,7 @@ public final class Benchmark { } } final long startTime = System.currentTimeMillis(); - System.out.print(" # 6. Starting benchmark ..."); // NOPMD (System.out) + System.out.println(" # 6. Starting benchmark ..."); // NOPMD (System.out) // 3. Starting Threads for (int i = 0; i < Benchmark.totalThreads; i++) { threads[i].start(); @@ -109,7 +100,7 @@ public final class Benchmark { System.exit(-1); } final long totalTime = System.currentTimeMillis() - startTime; - System.out.println("done (" + TimeUnit.MILLISECONDS.toSeconds(totalTime) + " s)"); // NOPMD (System.out) + System.out.println(" # done (" + TimeUnit.MILLISECONDS.toSeconds(totalTime) + " s)"); // NOPMD (System.out) // 5. Print experiment statistics System.out.print(" # 7. Writing results ... "); // NOPMD (System.out) @@ -143,6 +134,9 @@ public final class Benchmark { cmdlOpts.addOption(OptionBuilder.withLongOpt("output-filename").withArgName("filename").hasArg(true).isRequired(true) .withDescription("Filename of results file. Output is appended if file exists.").withValueSeparator('=').create("o")); cmdlOpts.addOption(OptionBuilder.withLongOpt("quickstart").isRequired(false).withDescription("Skips initial Garbage Collection.").create("q")); + cmdlOpts.addOption(OptionBuilder.withLongOpt("runnable").withArgName("classname").hasArg(true).isRequired(false) + .withDescription("Class implementing the Runnable interface. run() method is executed before the benchmark starts.").withValueSeparator('=') + .create("r")); try { CommandLine cmdl = null; final CommandLineParser cmdlParser = new BasicParser(); @@ -154,9 +148,13 @@ public final class Benchmark { Benchmark.recursionDepth = Integer.parseInt(cmdl.getOptionValue("recursiondepth")); Benchmark.quickstart = cmdl.hasOption("quickstart"); Benchmark.ps = new PrintStream(new BufferedOutputStream(new FileOutputStream(Benchmark.outputFn, true), 8192 * 8), false, Benchmark.ENCODING); + final String clazzname = cmdl.getOptionValue("runnable"); + if (null != clazzname) { + ((Runnable) Class.forName(clazzname).newInstance()).run(); + } } catch (final Exception ex) { // NOCS (e.g., IOException, ParseException, NumberFormatException) new HelpFormatter().printHelp(Benchmark.class.getName(), cmdlOpts); - ex.printStackTrace(); // NOPMD (Stacktrace) + System.out.println(ex.toString()); // NOPMD (Stacktrace) System.exit(-1); } } diff --git a/src/kieker/evaluation/benchmark/BenchmarkingThread.java b/src/mooBench/benchmark/BenchmarkingThread.java similarity index 95% rename from src/kieker/evaluation/benchmark/BenchmarkingThread.java rename to src/mooBench/benchmark/BenchmarkingThread.java index 9fc6794f6c74a62c5240ca4fd40a7d993abdd5a0..6f649e4d6fa2a9454ba5b2d2a82a43a6d4421d78 100644 --- a/src/kieker/evaluation/benchmark/BenchmarkingThread.java +++ b/src/mooBench/benchmark/BenchmarkingThread.java @@ -14,11 +14,11 @@ * limitations under the License. ***************************************************************************/ -package kieker.evaluation.benchmark; +package mooBench.benchmark; import java.util.concurrent.CountDownLatch; -import kieker.evaluation.monitoredApplication.MonitoredClass; +import mooBench.monitoredApplication.MonitoredClass; /** * @author Jan Waller diff --git a/src/kieker/evaluation/monitoredApplication/MonitoredClass.java b/src/mooBench/monitoredApplication/MonitoredClass.java similarity index 96% rename from src/kieker/evaluation/monitoredApplication/MonitoredClass.java rename to src/mooBench/monitoredApplication/MonitoredClass.java index ee8ea82e0baa06ffd1a0fde498444a13f7a3c8b1..b13c6faaea2cae7bcd0ac25d9d4777e506ff033b 100644 --- a/src/kieker/evaluation/monitoredApplication/MonitoredClass.java +++ b/src/mooBench/monitoredApplication/MonitoredClass.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.evaluation.monitoredApplication; +package mooBench.monitoredApplication; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean;