diff --git a/.classpath b/.classpath index 5634d6545ad8c6fefdea1b5531c9f438391cfa85..f1b36324ebde6f39f88e405a814507a8e103f165 100644 --- a/.classpath +++ b/.classpath @@ -12,7 +12,6 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="src" path="src/performancetest/java"/> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <attributes> <attribute name="maven.pomderived" value="true"/> diff --git a/.settings/edu.umd.cs.findbugs.core.prefs b/.settings/edu.umd.cs.findbugs.core.prefs index 9327e5ac834f5c14f603ba2eac938978a7c05575..cb17c2eda248ad25ecd5342499f1ef72007328f3 100644 --- a/.settings/edu.umd.cs.findbugs.core.prefs +++ b/.settings/edu.umd.cs.findbugs.core.prefs @@ -1,5 +1,5 @@ #FindBugs User Preferences -#Thu Mar 19 17:05:30 CET 2015 +#Mon Apr 20 12:42:35 CEST 2015 detector_threshold=3 effort=max excludefilter0=.fbExcludeFilterFile|true diff --git a/LICENSE.txt b/LICENSE.txt index 51aa7afaf65b774672b388bca032f7785c2872e7..a77fc9e449e82262846a685211eed9981f876743 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2015 TeeTime (http://teetime.sourceforge.net) + Copyright 2015 Christian Wulf, Nelson Tavares de Sousa Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/conf/quality-config/cs-conf.xml b/conf/quality-config/cs-conf.xml index abc40250ae3ee2096bc33bd415fa6aaca24c182a..1e33fb8d18bf71e268bc7ade7bee049d2390a610 100644 --- a/conf/quality-config/cs-conf.xml +++ b/conf/quality-config/cs-conf.xml @@ -465,7 +465,7 @@ <!-- Ensures that the setUp(), tearDown()methods are named correctly, have no arguments, !--> <!-- return void and are either public or protected. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> - <module name="JUnitTestCase"/> +<!-- <module name="JUnitTestCase"/> --> <!-- Checks that there are no "magic numbers", where a magic number is a numeric literal !--> <!-- that is not defined as a constant. !--> @@ -537,23 +537,12 @@ <!-- Ensure a class has a package declaration. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> <module name="PackageDeclaration"> - <property name="ignoreDirectoryName" value="false"/> </module> <!-- Disallow assignment of parameters. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> <module name="ParameterAssignment"/> - <!-- Checks for redundant exceptions declared in throws clause such as duplicates, !--> - <!-- unchecked exceptions or subclasses of another declared exception. !--> - <!-- See http://checkstyle.sf.net/config_coding.html !--> - <module name="RedundantThrows"> - <property name="allowUnchecked" value="true"/> - <property name="allowSubclasses" value="false"/> - <property name="logLoadErrors" value="true"/> - <property name="suppressLoadErrors" value="false"/> - </module> - <!-- Checks that code doesn't rely on the "this." default. !--> <!-- See http://checkstyle.sf.net/config_coding.html !--> <module name="RequireThis"> @@ -1210,6 +1199,8 @@ <property name="allowEmptyConstructors" value="true"/> <property name="allowEmptyMethods" value="true"/> </module> + + <module name="qa.cs.PluralForCollectionVariable" /> </module> diff --git a/experiments/results/blade2/Kieker.csv b/experiments/results/blade2/Kieker.csv deleted file mode 100644 index 3baa3f2c7cc1f42574d29644fa556d292475f140..0000000000000000000000000000000000000000 --- a/experiments/results/blade2/Kieker.csv +++ /dev/null @@ -1,20 +0,0 @@ -50;99703319;104370927;106408499;109646670;119511261;107238473;1193008 -100;199020106;208153845;213291928;218217473;232246810;213023365;1955142 -150;337297889;355560758;374306543;383545922;396757945;370360416;4929915 -200;467816371;495637042;516368133;534205012;559056847;516459829;6232480 -250;596127470;638856007;661346771;682121844;695630448;657343736;7369335 -300;716906859;742194975;769882958;782240095;830910818;769855241;8747627 -350;850336524;881553010;900993919;929031728;955373859;902102545;8244969 -400;969656446;1006937063;1023078332;1038249029;1075693049;1025527167;7191492 -450;1062203254;1117993711;1135809741;1157953147;1196129302;1136791217;8549326 -500;1194488793;1247819027;1265504819;1285478406;1338339829;1267369035;8747083 -550;1298891408;1360376230;1383581626;1396040687;1446252630;1379434067;8288796 -600;1411700331;1476794279;1495615473;1531373285;1563679683;1497879441;10907616 -650;1523133256;1592382895;1634060782;1653097655;1703704527;1623416690;11309726 -700;1651870606;1712296106;1745785579;1773041064;1833366800;1744948478;10870921 -750;1799434427;1857202331;1885811314;1901945050;1971356158;1884567832;11106500 -800;1945131323;1988332302;2016273307;2047321799;2101658581;2021289324;12028477 -850;2033874834;2087867598;2122065580;2144124665;2227767654;2121055456;11960673 -900;2128397748;2196552897;2252379476;2289845931;2360001206;2248629789;15635257 -950;2276660049;2357153010;2409342166;2455613183;2543463792;2410879283;17592400 -1000;2397618110;2483455455;2537434804;2586458979;2648410314;2536206534;17752209 diff --git a/experiments/results/blade2/TeeTime.csv b/experiments/results/blade2/TeeTime.csv deleted file mode 100644 index 4e32792c325d19d911f4bc71328a08bf6c6c5305..0000000000000000000000000000000000000000 --- a/experiments/results/blade2/TeeTime.csv +++ /dev/null @@ -1,20 +0,0 @@ -50;42972259;45705357;47674512;49547679;57755333;47888261;929367 -100;85877309;88345443;89831326;91647941;110193010;90534690;1108752 -150;126542704;127838796;129663613;132717583;138291205;130759226;849159 -200;163076624;169231946;171284689;173014501;177875192;171042545;1003788 -250;202760043;212712891;216424930;222157391;243168778;217828254;2127960 -300;244925102;254847492;261454494;268472096;279746994;262023035;2473294 -350;295270442;303466249;311341637;319395334;333577327;311815751;2871671 -400;341138790;352799999;362377914;368274816;384423758;361844612;2798439 -450;396709128;406946841;414903572;421594412;448577762;415427408;3346928 -500;436940925;455844783;463249285;471076154;487311733;463060680;3505921 -550;490942852;503270240;513216035;525717230;553667863;514508002;3871242 -600;534018864;551909955;563407664;576517848;608233860;564258423;4708689 -650;585511008;603485683;612588236;620917386;649830018;612712354;3755875 -700;625806026;644548893;653980673;668725528;688883586;656102636;5037661 -750;660155249;679620551;693767944;709739711;737548853;694983836;5521214 -800;706846579;722188246;733573899;754445900;797507209;738714440;6181884 -850;756893281;773948241;788668441;803770175;832249265;789954631;5736511 -900;802499245;820658704;835403073;848752408;864517350;835618338;4730065 -950;847020492;870432045;889375145;898214737;928178183;886081861;5345163 -1000;894084162;917140730;929015152;933826580;961602850;927688230;4714804 diff --git a/experiments/results/chw-home/Kieker.csv b/experiments/results/chw-home/Kieker.csv deleted file mode 100644 index 813a2fdafa87854232129da86e91bdc1c6014c8c..0000000000000000000000000000000000000000 --- a/experiments/results/chw-home/Kieker.csv +++ /dev/null @@ -1,20 +0,0 @@ -50;55192543;57460829;58720631;59471070;68356974;59104739;719930 -100;112944771;116962912;117861099;118904107;124795567;118259015;615219 -150;197336862;200525571;205128265;209809954;225915873;207242848;2129381 -200;260795647;271667216;277632111;284376702;300601405;278976020;2332638 -250;327968010;341060761;349715827;355444620;368655570;349381117;2711402 -300;403260622;416040618;427751567;443155321;524093929;436648353;7841529 -350;455973935;480969562;486255697;491892622;514066129;486514784;3087561 -400;523391178;545019921;551934495;558768028;595911407;552970569;3985442 -450;583940657;617119729;627036353;635250811;655591958;626617622;4611909 -500;651924313;686916142;698362024;710417619;736700549;699362609;4297125 -550;718410894;746477031;758306178;769407998;798066295;757779167;5100886 -600;784048733;806062203;824597615;834223718;866035907;822537789;6077305 -650;820801534;866889624;890863892;907769109;927715874;886504298;8091027 -700;878869736;938875330;969254517;980259204;1003336163;959789010;8279975 -750;947249238;990684606;1025992409;1054315713;1097805499;1023776953;10511749 -800;1013643367;1060443277;1088546570;1112696087;1156581718;1086779670;9252808 -850;1079448262;1132988082;1174349429;1190311404;1218065370;1162456069;10698345 -900;1128981351;1179976115;1221295916;1252696169;1273740652;1214642477;11873606 -950;1213440441;1291227789;1314440792;1330603470;1356654685;1305970559;10281130 -1000;1265263467;1321908614;1374805076;1412596204;1446151226;1368249384;14828493 diff --git a/experiments/results/chw-home/TeeTime.csv b/experiments/results/chw-home/TeeTime.csv deleted file mode 100644 index 9f0ceef60295e14db672e2da6f2c6fd6474846d0..0000000000000000000000000000000000000000 --- a/experiments/results/chw-home/TeeTime.csv +++ /dev/null @@ -1,20 +0,0 @@ -50;23719147;24224415;24556480;24966661;26641911;24637375;156333 -100;46846428;49305179;49937419;50441516;53028410;49837454;320676 -150;68027249;72912564;74121167;74971958;85937441;74059844;718037 -200;91326560;94605673;98486892;99291749;104344707;97521426;850592 -250;114627335;117963206;119062680;120667420;125979594;119414557;729333 -300;138366962;141700200;144498037;147383643;156184995;145001711;1170621 -350;164774526;169447144;173284771;176384246;184307305;173218474;1345961 -400;188961491;197178290;200394792;204703163;211820487;200851802;1637455 -450;215202583;219689421;224042261;228881936;241205231;225549979;1993251 -500;237638231;246374339;255144679;262169843;270582370;255362981;2699593 -550;262621570;275312625;282884893;287775183;296126563;281203096;2489021 -600;287798003;296009243;305027095;312065425;327250923;306079032;3088091 -650;313336053;321866485;327989659;337157307;353032096;330145073;3093973 -700;338501660;346819103;353133911;360440819;381988228;354366240;2742501 -750;360091200;367737781;373113735;379424154;388375008;373389434;1921847 -800;379083896;394145053;414746293;429602065;495171735;416848289;7638394 -850;402335812;415287838;424387902;433808621;446666441;424498095;2969743 -900;434722314;443555848;450499093;456066387;498858103;451649404;3461327 -950;448993241;460752464;469636905;475704492;491897889;469305365;2954267 -1000;479168215;490081328;494116147;500748684;519045359;495833420;2542993 diff --git a/experiments/results/chw-home/i7-3.5GHz-rev-26e53fc3ce9101294bd80a236c2b329e05872f93.txt b/experiments/results/chw-home/i7-3.5GHz-rev-26e53fc3ce9101294bd80a236c2b329e05872f93.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/experiments/results/chw-work/Kieker.csv b/experiments/results/chw-work/Kieker.csv deleted file mode 100644 index f8865fde91579dec5002b39d8a37f64057123953..0000000000000000000000000000000000000000 --- a/experiments/results/chw-work/Kieker.csv +++ /dev/null @@ -1,20 +0,0 @@ -50;213288022;221332661;224869330;226740501;292880519;226981248;3394698 -100;428366753;440645131;447250470;452626290;469420849;447253237;2502077 -150;685240575;696427369;707731163;712835213;734419362;706963941;3174182 -200;926724655;960090857;974751099;985512590;1008813961;971116232;5485152 -250;1181356193;1199890144;1230271423;1254058035;1435951193;1232944413;11502559 -300;1404383088;1451900893;1475425591;1494546592;1530113206;1475832510;8629307 -350;1643973007;1702753553;1723329453;1744498971;1772843227;1720735815;8429278 -400;1883990693;1926251730;1961868018;1998996267;2028847559;1960663941;11520331 -450;2093457553;2160674377;2196177360;2237898969;2337703230;2200014926;13484216 -500;2351931190;2403737744;2440280586;2493890164;2675840385;2451017238;17919723 -550;2620308321;2741547299;2778395572;2804673658;3167646315;2775641001;24014167 -600;2822565959;2984355731;3011144099;3041297126;3117151797;3007385484;17716813 -650;3096633370;3206939671;3257238779;3297084291;3555764011;3251618903;24112459 -700;3353953023;3509161265;3549487091;3584125098;3788453833;3545014072;23459360 -750;3593827025;3725989652;3790618529;3834291360;3942594712;3784587299;22531680 -800;3994363498;4096651433;4161083259;4201211211;4329658181;4156200037;22852870 -850;4245739166;4390972894;4467851413;4545305899;4871212706;4478115175;38396394 -900;4534080926;4728535725;4784857228;4865421026;5009165781;4799001858;29669971 -950;4882368300;5107065209;5150676462;5217475373;5564924455;5155846903;36288606 -1000;5353426320;5517819639;5568789133;5648063473;5825645303;5572898368;27980146 diff --git a/experiments/results/chw-work/TeeTime.csv b/experiments/results/chw-work/TeeTime.csv deleted file mode 100644 index b3e2308cb9f3ebf4382e69a04d3fb4cf5e6c9b05..0000000000000000000000000000000000000000 --- a/experiments/results/chw-work/TeeTime.csv +++ /dev/null @@ -1,20 +0,0 @@ -50;37409870;39712091;40551614;41872681;46981249;40825827;520100 -100;74848886;77594063;79350288;82620526;96710959;80682800;1242332 -150;109509472;113130299;114992028;116545042;141809133;116038733;1445413 -200;149576667;154103932;158648849;160472809;166534204;157647883;1147641 -250;186351044;195045954;197574786;200420541;205740939;197833070;1161424 -300;227567297;236209249;239537372;240841608;254943126;238988007;1273608 -350;263962350;274421694;278554856;282444575;297325268;278963959;1906965 -400;301652197;310932104;318158978;324177268;347633408;318831228;2748566 -450;345764700;350349028;356190792;361479579;374075294;356693717;1938489 -500;385523591;394501763;402854706;409270794;428996087;402743847;2759305 -550;418006345;431712117;437322756;448968927;466004463;440010788;3243488 -600;462762141;478331694;486726100;497015897;513094090;487001266;3464966 -650;498716701;509037287;521511896;527900069;613747728;521387975;4867196 -700;548439432;565718820;571012535;576878519;593948540;571424372;2690897 -750;601339623;610144553;617716268;624627039;641422007;618261584;2674503 -800;622111344;642761960;653135914;658724386;715327919;651870382;4386503 -850;655329758;672637472;688432814;697900331;721996068;686312192;4610008 -900;685596911;721248914;730479558;739256163;760854679;730598323;4593658 -950;750978691;766349140;775656552;781562357;804829657;775844350;3187702 -1000;782708542;811284334;816156850;824923190;847850986;816902190;3685762 diff --git a/experiments/results/evaluation.xlsx b/experiments/results/evaluation.xlsx deleted file mode 100644 index 5a62baf8e4f79279c96fbbb50b562cb8f244eceb..0000000000000000000000000000000000000000 Binary files a/experiments/results/evaluation.xlsx and /dev/null differ diff --git a/experiments/results/overhead-findings.txt b/experiments/results/overhead-findings.txt deleted file mode 100644 index 716448668817907baac6044e2bfc9b8b70f82c48..0000000000000000000000000000000000000000 --- a/experiments/results/overhead-findings.txt +++ /dev/null @@ -1,34 +0,0 @@ -[increases overhead (first is slower)] --for loop with list vs. array (reason: due to new instantiation of iterator) --for loop with super type vs. concrete type (reason: due to less JIT optimization possibilities) --passing by argument vs. instance variable (reason: unknown) --pipe with array vs. single element (reason: unknown) --access via array wrapper vs. array directly -- - -[irrelevant w.r.t. overhead] --foreach vs. index-based iteration --iterative vs. recursive execution --null-check vs. NullObject --AbstractPipe vs. IPipe -- - - -[analysis performance results (50%)] - -2: 7400 ns -8: 1200 ns (iterative; argument/return w/o pipe) -9: 9400 ns (executeWithPorts: queued pipe) -10: 4900 ns (executeWithPorts: single element pipe) - 10: 5400 ns (executeWithPorts: single element pipe; with setReschedulable() after each read) -11: 7400 ns (executeWithPorts: fixed sized pipe) - 11: 8600 ns (executeWithPorts: fixed sized pipe; with CircularArray(int)) - 11: 8200 ns (executeWithPorts: fixed sized pipe; with CircularArray(int) w/o mask) - 11: 7800 ns (executeWithPorts: fixed sized pipe; with setReschedulable() after each read) - 11: 8200 ns (executeWithPorts: fixed sized pipe; with setReschedulable() after each read; non-final elements) - 11: 7800 ns (executeWithPorts: fixed sized pipe; with setReschedulable() after each read; non-final elements; pipeline searches for firstStageIndex) -12: 3300 ns (recursive; argument/return w/o pipe) -13: 3300 ns (recursive; argument/return w/o pipe; w/o pipeline class) -14: 21,000 ns (spsc pipe) -16: 14,500 ns (with distributor thread) -17: 8600 ns (as 16, but with direct feeding of SpScPipe) diff --git a/experiments/scripts/MooBench-cmd/.gitignore b/experiments/scripts/MooBench-cmd/.gitignore deleted file mode 100644 index ceeb05b410818bc6c355257ab68798073b83bb7a..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/tmp diff --git a/experiments/scripts/MooBench-cmd/META-INF/kieker.aop.xml b/experiments/scripts/MooBench-cmd/META-INF/kieker.aop.xml deleted file mode 100644 index 21d93b0ad698128b77dfe0433b4214ac8265fa8d..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/META-INF/kieker.aop.xml +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.aspectj.org/dtd/aspectj_1_5_0.dtd"> -<aspectj> - <weaver options=""> - <include within="mooBench.monitoredApplication.*"/> - <include within="kieker.monitoring.probe..*"/> - </weaver> - <aspects> - <aspect name="kieker.monitoring.probe.aspectj.flow.operationExecution.FullInstrumentation" /> - </aspects> -</aspectj> diff --git a/experiments/scripts/MooBench-cmd/META-INF/kieker.legacy.aop.xml b/experiments/scripts/MooBench-cmd/META-INF/kieker.legacy.aop.xml deleted file mode 100644 index a3e02fd16fe213174a8dfb2d151d4d0cda093477..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/META-INF/kieker.legacy.aop.xml +++ /dev/null @@ -1,9 +0,0 @@ -<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.aspectj.org/dtd/aspectj_1_5_0.dtd"> -<aspectj> - <weaver options=""> - <include within="mooBench.monitoredApplication.*"/> - </weaver> - <aspects> - <aspect name="kieker.monitoring.probe.aspectj.operationExecution.OperationExecutionAspectFull"/> - </aspects> -</aspectj> diff --git a/experiments/scripts/MooBench-cmd/META-INF/kieker.logging.properties b/experiments/scripts/MooBench-cmd/META-INF/kieker.logging.properties deleted file mode 100644 index f98649baf98e11754e888f5e06069b9dba5df31b..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/META-INF/kieker.logging.properties +++ /dev/null @@ -1,5 +0,0 @@ -handlers = java.util.logging.FileHandler -java.util.logging.FileHandler.level = ALL -java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter -java.util.logging.FileHandler.append = true -java.util.logging.FileHandler.pattern = kieker.log diff --git a/experiments/scripts/MooBench-cmd/META-INF/kieker.monitoring.properties b/experiments/scripts/MooBench-cmd/META-INF/kieker.monitoring.properties deleted file mode 100644 index 52c0d13ef363b598fc1d4c38dd57aad45aadc49f..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/META-INF/kieker.monitoring.properties +++ /dev/null @@ -1,29 +0,0 @@ -kieker.monitoring.enabled=true -kieker.monitoring.name=KIEKER-BENCHMARK - -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.AsyncBinaryFsWriter.QueueSize=100000 -kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.QueueFullBehavior=1 -kieker.monitoring.writer.filesystem.AsyncBinaryFsWriter.bufferSize=16777216 - -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 -#kieker.monitoring.writer.tcp.TCPWriter.hostname=blade2 - diff --git a/experiments/scripts/MooBench-cmd/MooBench.jar b/experiments/scripts/MooBench-cmd/MooBench.jar deleted file mode 100644 index 9232679c05b83488fc352c39f0e838e8ca9f551b..0000000000000000000000000000000000000000 Binary files a/experiments/scripts/MooBench-cmd/MooBench.jar and /dev/null differ diff --git a/experiments/scripts/MooBench-cmd/lib/kieker-1.9_aspectj.jar b/experiments/scripts/MooBench-cmd/lib/kieker-1.9_aspectj.jar deleted file mode 100644 index 1eccaeeec73b0737030ce3ba782e3f72209f7eba..0000000000000000000000000000000000000000 Binary files a/experiments/scripts/MooBench-cmd/lib/kieker-1.9_aspectj.jar and /dev/null differ diff --git a/experiments/scripts/MooBench-cmd/startMooBench.cmd b/experiments/scripts/MooBench-cmd/startMooBench.cmd deleted file mode 100644 index 456f122ec63b94ec2551cf5bea7d6dee68fae997..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/startMooBench.cmd +++ /dev/null @@ -1,16 +0,0 @@ -@echo off - -set runs=%1 -set calls=%2 - -if [%calls%] == [] ( - set calls=1000000 -) - -set cp=.;MooBench.jar;META-INF/kieker.monitoring.properties;META-INF/kieker.logging.properties -set jvmParams=-javaagent:lib/kieker-1.9_aspectj.jar -Dorg.aspectj.weaver.loadtime.configuration=META-INF/kieker.aop.xml -Dorg.aspectj.weaver.showWeaveInfo=true -Daj.weaving.verbose=true -Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.TCPWriter -set params=-d 10 -h 1 -m 0 -t %calls% -o tmp/test.txt -q - -for /l %%i in (1, 1, %runs%) do ( - java -cp %cp% %jvmParams% mooBench.benchmark.Benchmark %params% -) \ No newline at end of file diff --git a/experiments/scripts/MooBench-cmd/startMooBench.sh b/experiments/scripts/MooBench-cmd/startMooBench.sh deleted file mode 100644 index 2d16af84c7c0b9e558936c29e208f3e39448d0c5..0000000000000000000000000000000000000000 --- a/experiments/scripts/MooBench-cmd/startMooBench.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -java=~/jdk1.7.0_60/bin/java -cp=.:MooBench.jar:META-INF/kieker.monitoring.properties:META-INF/kieker.logging.properties -jvmParams="-javaagent:lib/kieker-1.9_aspectj.jar -Dorg.aspectj.weaver.loadtime.configuration=META-INF/kieker.aop.xml -Dorg.aspectj.weaver.showWeaveInfo=true -Daj.weaving.verbose=true -Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.TCPWriter" -params="-d 10 -h 1 -m 0 -t 1000000 -o tmp/test.txt -q" -#runs=$1 - -for i in {1..3}; do - ${java} -cp ${cp} ${jvmParams} mooBench.benchmark.Benchmark ${params}; -done diff --git a/experiments/scripts/benchmark-kieker-days-ffi.sh b/experiments/scripts/benchmark-kieker-days-ffi.sh deleted file mode 100644 index 711dc92dd7cb37ecc1d9944d0d9d54a44c924412..0000000000000000000000000000000000000000 --- a/experiments/scripts/benchmark-kieker-days-ffi.sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/bash - -JAVABIN="/localhome/chw/jdk1.7.0_60/bin/" - -RSCRIPTDIR=bin/icpe/r/ -BASEDIR=./ -RESULTSDIR="${BASEDIR}tmp/results-benchmark-kieker-days-ffi/" - -SLEEPTIME=30 ## 30 -NUM_LOOPS=1 ## 10 -THREADS=1 ## 1 -RECURSIONDEPTH=10 ## 10 -TOTALCALLS=20000 ## 20000000 -METHODTIME=0 ## 0 - -MOREPARAMS="" -#MOREPARAMS="--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/ - -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" -JARNoInstru="-jar dist/OverheadEvaluationMicrobenchmarkTCPffiNoInstru.jar" -JARDeactived="-jar dist/OverheadEvaluationMicrobenchmarkTCPffiDeactivated.jar" -JARCollecting="-jar dist/OverheadEvaluationMicrobenchmarkTCPffiCollecting.jar" -JARNORMAL="-jar dist/OverheadEvaluationMicrobenchmarkTCPffiNormal.jar" - -JAVAARGS_NOINSTR="${JAVAARGS}" -JAVAARGS_LTW="${JAVAARGS} -javaagent:${BASEDIR}lib/aspectjweaver.jar -Dorg.aspectj.weaver.showWeaveInfo=false -Daj.weaving.verbose=false -Dorg.aspectj.weaver.loadtime.configuration=META-INF/kieker-overhead-benchmark.aop.xml" - -## 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}" - - # No instrumentation - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} No instrumentation" - sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 & - ${JAVABIN}java ${JAVAARGS_NOINSTR} ${JARNoInstru} \ - --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 - sync - sleep ${SLEEPTIME} - - # Deactivated Probe - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Deactivated Probe" - sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 & - ${JAVABIN}java -jar dist/explorviz_worker.jar >${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_LTW} ${JARDeactived} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %sar - pkill -f 'java -jar' - [ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log - sync - sleep ${SLEEPTIME} - - # Collecting - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Collecting" - sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 & - ${JAVABIN}java -jar dist/explorviz_worker.jar >${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_LTW} ${JARCollecting} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %sar - pkill -f 'java -jar' - [ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log - sync - sleep ${SLEEPTIME} - - # Logging - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 & - ${JAVABIN}java -jar dist/explorviz_worker.jar >${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_LTW} ${JARNORMAL} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %sar - pkill -f 'java -jar' - [ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log - sync - sleep ${SLEEPTIME} - - # Reconstruction - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Reconstruction" - sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 & - ${JAVABIN}java -jar dist/explorviz_workerReconstruction.jar >${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_LTW} ${JARNORMAL} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %sar - pkill -f 'java -jar' - [ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log - sync - sleep ${SLEEPTIME} - - # Reduction - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Reduction" - sar -o ${RESULTSDIR}stat/sar-${i}-${j}-${k}.data 5 2000 1>/dev/null 2>&1 & - ${JAVABIN}java -jar dist/explorviz_workerReduction.jar >${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_LTW} ${JARNORMAL} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %sar - pkill -f 'java -jar' - [ -f ${BASEDIR}hotspot.log ] && mv ${BASEDIR}hotspot.log ${RESULTSDIR}hotspot-${i}-${j}-${k}.log - sync - sleep ${SLEEPTIME} - -done -zip -jqr ${RESULTSDIR}stat.zip ${RESULTSDIR}stat -rm -rf ${RESULTSDIR}stat/ -[ -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 -# Timeseries -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-timeseries.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -tsconf.min=(${METHODTIME}/1000) -tsconf.max=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}timeseries.r") -EOF -# Timeseries-Average -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-timeseries-average.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -tsconf.min=(${METHODTIME}/1000) -tsconf.max=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}timeseries-average.r") -EOF -# Throughput -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-throughput.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -source("${RSCRIPTDIR}throughput.r") -EOF -# Throughput-Average -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-throughput-average.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -source("${RSCRIPTDIR}throughput-average.r") -EOF -# 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","TCP Writer","Reconstruction","Reduction") -results.count=${TOTALCALLS} -results.skip=${TOTALCALLS}/2 -bars.minval=(${METHODTIME}/1000) -bars.maxval=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}bar.r") -EOF - -## Clean up raw results -zip -jqr ${RESULTSDIR}results.zip ${RAWFN}* -rm -f ${RAWFN}* -zip -jqr ${RESULTSDIR}worker.zip ${RESULTSDIR}worker*.log -rm -f ${RESULTSDIR}worker*.log -[ -f ${BASEDIR}nohup.out ] && mv ${BASEDIR}nohup.out ${RESULTSDIR} diff --git a/experiments/scripts/benchmark-kieker-days-kieker.sh b/experiments/scripts/benchmark-kieker-days-kieker.sh deleted file mode 100644 index 978a180f55b10f1a65090c6867654d067fc31be7..0000000000000000000000000000000000000000 --- a/experiments/scripts/benchmark-kieker-days-kieker.sh +++ /dev/null @@ -1,303 +0,0 @@ -#!/bin/bash - -JAVABIN="/localhome/chw/jdk1.7.0_60/bin/" - -RSCRIPTDIR=bin/icpe/r/ -BASEDIR=./ -RESULTSDIR="${BASEDIR}tmp/results-benchmark-kieker-days-kieker/" - -compressCmd="zip -jqr" -compressExt="zip" -#compressCmd="tar cfv" -#compressExt="tar" - -SLEEPTIME=30 ## 30 -NUM_LOOPS=1 ## 10 -THREADS=1 ## 1 -RECURSIONDEPTH=10 ## 10 -TOTALCALLS=20000 ## 20000000 -METHODTIME=0 ## 0 - -#MOREPARAMS="" -MOREPARAMS="--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/OverheadEvaluationMicrobenchmarkKieker.jar" - -JAVAARGS_NOINSTR="${JAVAARGS}" -JAVAARGS_LTW="${JAVAARGS} -javaagent:${BASEDIR}lib/kieker-1.10-SNAPSHOT_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_LOGGING="${JAVAARGS_LTW} -Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.TCPWriter -Dkieker.monitoring.writer.tcp.TCPWriter.QueueSize=100000 -Dkieker.monitoring.writer.tcp.TCPWriter.QueueFullBehavior=1 -Dkieker.monitoring.writer.tcp.TCPWriter.hostname=localhost" - -## 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 - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java ${JAVAARGS_NOINSTR} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - [ -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 - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java ${JAVAARGS_KIEKER_DEACTV} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - [ -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 - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java ${JAVAARGS_KIEKER_NOLOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - [ -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 - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - echo " # ${i}.${j}.${k} Logging" >>${BASEDIR}kieker.log - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java -jar dist/KiekerTCPReader1.jar 2>${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - pkill -f 'java -jar' - 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} - - # Reconstruction - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - echo " # ${i}.${j}.${k} Logging" >>${BASEDIR}kieker.log - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java -jar dist/KiekerTCPReader2.jar 2>${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - pkill -f 'java -jar' - 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} - - # Reduction - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - echo " # ${i}.${j}.${k} Logging" >>${BASEDIR}kieker.log - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java -jar dist/KiekerTCPReader3.jar 2>${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - pkill -f 'java -jar' - 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 -${compressCmd} ${RESULTSDIR}stat.${compressExt} ${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 -# Timeseries -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-timeseries.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -tsconf.min=(${METHODTIME}/1000) -tsconf.max=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}timeseries.r") -EOF -# Timeseries-Average -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-timeseries-average.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -tsconf.min=(${METHODTIME}/1000) -tsconf.max=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}timeseries-average.r") -EOF -# Throughput -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-throughput.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -source("${RSCRIPTDIR}throughput.r") -EOF -# Throughput-Average -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-throughput-average.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -source("${RSCRIPTDIR}throughput-average.r") -EOF -# 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","TCP Writer","Reconstruction","Reduction") -results.count=${TOTALCALLS} -results.skip=${TOTALCALLS}/2 -bars.minval=(${METHODTIME}/1000) -bars.maxval=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}bar.r") -EOF - -## Clean up raw results -#zip -jqr ${RESULTSDIR}results.zip ${RAWFN}* -${compressCmd} ${RESULTSDIR}results.${compressExt} ${RAWFN}* -rm -f ${RAWFN}* -#zip -jqr ${RESULTSDIR}worker.zip ${RESULTSDIR}worker*.log -${compressCmd} ${RESULTSDIR}worker.${compressExt} ${RESULTSDIR}worker*.log -rm -f ${RESULTSDIR}worker*.log -[ -f ${BASEDIR}nohup.out ] && mv ${BASEDIR}nohup.out ${RESULTSDIR} diff --git a/experiments/scripts/benchmark-kieker-days-teetime.sh b/experiments/scripts/benchmark-kieker-days-teetime.sh deleted file mode 100644 index baaf9932ef6631094dc71f85d8aeb7bcba0dfd33..0000000000000000000000000000000000000000 --- a/experiments/scripts/benchmark-kieker-days-teetime.sh +++ /dev/null @@ -1,305 +0,0 @@ -#!/bin/bash - -JAVABIN="/localhome/chw/jdk1.7.0_60/bin/" - -RSCRIPTDIR=bin/icpe/r/ -BASEDIR=./ -RESULTSDIR="${BASEDIR}tmp/results-benchmark-kieker-days-teetime/" - -TEETIME_CLASSPATH="dist/teetime.jar:lib/teetime/*" - -compressCmd="zip -jqr" -compressExt="zip" -#compressCmd="tar cfv" -#compressExt="tar" - -SLEEPTIME=30 ## 30 -NUM_LOOPS=1 ## 10 -THREADS=1 ## 1 -RECURSIONDEPTH=10 ## 10 -TOTALCALLS=20000 ## 20000000 -METHODTIME=0 ## 0 - -#MOREPARAMS="" -MOREPARAMS="--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/OverheadEvaluationMicrobenchmarkKieker.jar" - -JAVAARGS_NOINSTR="${JAVAARGS}" -JAVAARGS_LTW="${JAVAARGS} -javaagent:${BASEDIR}lib/kieker-1.10-SNAPSHOT_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_LOGGING="${JAVAARGS_LTW} -Dkieker.monitoring.writer=kieker.monitoring.writer.tcp.TCPWriter -Dkieker.monitoring.writer.tcp.TCPWriter.QueueSize=100000 -Dkieker.monitoring.writer.tcp.TCPWriter.QueueFullBehavior=1" - -## 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 - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java ${JAVAARGS_NOINSTR} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - [ -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 - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java ${JAVAARGS_KIEKER_DEACTV} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - [ -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 - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java ${JAVAARGS_KIEKER_NOLOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - [ -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 - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - echo " # ${i}.${j}.${k} Logging" >>${BASEDIR}kieker.log - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java -cp ${TEETIME_CLASSPATH} teetime.variant.methodcallWithPorts.examples.kiekerdays.TcpTraceLogging 2>${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - pkill -f 'java -jar' - 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} - - # Reconstruction - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - echo " # ${i}.${j}.${k} Logging" >>${BASEDIR}kieker.log - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java -cp ${TEETIME_CLASSPATH} teetime.variant.methodcallWithPorts.examples.kiekerdays.TcpTraceReconstruction 1 2>${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - pkill -f 'java -jar' - 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} - - # Reduction - k=`expr ${k} + 1` - echo " # ${i}.${j}.${k} Logging" - echo " # ${i}.${j}.${k} Logging" >>${BASEDIR}kieker.log - mpstat 1 > ${RESULTSDIR}stat/mpstat-${i}-${j}-${k}.txt & - vmstat 1 > ${RESULTSDIR}stat/vmstat-${i}-${j}-${k}.txt & - iostat -xn 10 > ${RESULTSDIR}stat/iostat-${i}-${j}-${k}.txt & - ${JAVABIN}java -cp ${TEETIME_CLASSPATH} teetime.variant.methodcallWithPorts.examples.kiekerdays.TcpTraceReduction 1 2>${RESULTSDIR}worker-${i}-${j}-${k}.log & - sleep 5 - ${JAVABIN}java ${JAVAARGS_KIEKER_LOGGING} ${JAR} \ - --output-filename ${RAWFN}-${i}-${j}-${k}.csv \ - --totalcalls ${TOTALCALLS} \ - --methodtime ${METHODTIME} \ - --totalthreads ${THREADS} \ - --recursiondepth ${j} \ - ${MOREPARAMS} - kill %mpstat - kill %vmstat - kill %iostat - pkill -f 'java -jar' - 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 -${compressCmd} ${RESULTSDIR}stat.${compressExt} ${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 -# Timeseries -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-timeseries.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -tsconf.min=(${METHODTIME}/1000) -tsconf.max=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}timeseries.r") -EOF -# Timeseries-Average -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-timeseries-average.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -tsconf.min=(${METHODTIME}/1000) -tsconf.max=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}timeseries-average.r") -EOF -# Throughput -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-throughput.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -source("${RSCRIPTDIR}throughput.r") -EOF -# Throughput-Average -R --vanilla --silent <<EOF -results_fn="${RAWFN}" -output_fn="${RESULTSDIR}results-throughput-average.pdf" -configs.loop=${NUM_LOOPS} -configs.recursion=c(${RECURSIONDEPTH}) -configs.labels=c("No Probe","Deactivated Probe","Collecting Data","TCP Writer","Reconstruction","Reduction") -configs.colors=c("black","red","blue","green","yellow","purple") -results.count=${TOTALCALLS} -source("${RSCRIPTDIR}throughput-average.r") -EOF -# 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","TCP Writer","Reconstruction","Reduction") -results.count=${TOTALCALLS} -results.skip=${TOTALCALLS}/2 -bars.minval=(${METHODTIME}/1000) -bars.maxval=(${METHODTIME}/1000)+40 -source("${RSCRIPTDIR}bar.r") -EOF - -## Clean up raw results -#zip -jqr ${RESULTSDIR}results.zip ${RAWFN}* -${compressCmd} ${RESULTSDIR}results.${compressExt} ${RAWFN}* -rm -f ${RAWFN}* -#zip -jqr ${RESULTSDIR}worker.zip ${RESULTSDIR}worker*.log -${compressCmd} ${RESULTSDIR}worker.${compressExt} ${RESULTSDIR}worker*.log -rm -f ${RESULTSDIR}worker*.log -[ -f ${BASEDIR}nohup.out ] && mv ${BASEDIR}nohup.out ${RESULTSDIR} diff --git a/experiments/scripts/teetime-cmd/lib/kieker-1.9_aspectj.jar b/experiments/scripts/teetime-cmd/lib/kieker-1.9_aspectj.jar deleted file mode 100644 index 1eccaeeec73b0737030ce3ba782e3f72209f7eba..0000000000000000000000000000000000000000 Binary files a/experiments/scripts/teetime-cmd/lib/kieker-1.9_aspectj.jar and /dev/null differ diff --git a/experiments/scripts/teetime-cmd/startTeetime.cmd b/experiments/scripts/teetime-cmd/startTeetime.cmd deleted file mode 100644 index 32fa1e1274745c3173662acefb8a0787a7399c56..0000000000000000000000000000000000000000 --- a/experiments/scripts/teetime-cmd/startTeetime.cmd +++ /dev/null @@ -1,6 +0,0 @@ - -set cp=.;teetime.jar;lib/kieker-1.9_aspectj.jar -set jvmParams= -set params= - -java -cp %cp% %jvmParams% teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads.ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest %params% \ No newline at end of file diff --git a/experiments/scripts/teetime-cmd/startTeetime.sh b/experiments/scripts/teetime-cmd/startTeetime.sh deleted file mode 100644 index 95bf69d0f8034468412441beb94d975c08b4836b..0000000000000000000000000000000000000000 --- a/experiments/scripts/teetime-cmd/startTeetime.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -java=~/jdk1.7.0_60/bin/java -cp=.:teetime.jar:lib/kieker-1.9_aspectj.jar -jvmParams="" -params= - -JAVAARGS="-server" -JAVAARGS="${JAVAARGS} -d64" -JAVAARGS="${JAVAARGS} -Xms1G -Xmx1G" -JAVAARGS="${JAVAARGS} -verbose:gc -XX:+PrintCompilation" - -${java} ${JAVAARGS} ${jvmParams} -cp ${cp} teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads.ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest ${params} \ No newline at end of file diff --git a/experiments/scripts/teetime-cmd/teetime.jar b/experiments/scripts/teetime-cmd/teetime.jar deleted file mode 100644 index 65e8cda195a9bbfba2036f1c948757c9e0ea914e..0000000000000000000000000000000000000000 Binary files a/experiments/scripts/teetime-cmd/teetime.jar and /dev/null differ diff --git a/pom.xml b/pom.xml index 62f7bfc2234af57dd86cbd0394253d9c485303f3..25ff341451f70d2baccc9ff7e5f310f1a3a00c94 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ <packaging>jar</packaging> <name>TeeTime</name> - <description>TeeTime is a Pipes-and-Filters framework for Java</description> + <description>TeeTime is a Pipe-and-Filter framework for Java</description> <url>http://teetime.sourceforge.org</url> <inceptionYear>2015</inceptionYear> @@ -73,6 +73,13 @@ <url>https://build.se.informatik.uni-kiel.de/jenkins/view/TeeTime/</url> </ciManagement> + <repositories> + <repository> + <id>jitpack.io</id> + <url>https://jitpack.io</url> + </repository> + </repositories> + <dependencies> <dependency> <groupId>junit</groupId> @@ -108,11 +115,23 @@ <artifactId>guava</artifactId> <version>18.0</version> </dependency> + <!-- <dependency> --> + <!-- <groupId>org.jctools</groupId> --> + <!-- <artifactId>jctools-core</artifactId> --> + <!-- <version>1.0</version> --> + <!-- <version>1.1-SNAPSHOT</version> --> + <!-- </dependency> --> + <dependency> + <groupId>com.github.JCTools</groupId> + <artifactId>JCTools</artifactId> + <!-- SNAPSHOT master version --> + <version>7239659ba0</version> + </dependency> + <dependency> - <groupId>org.jctools</groupId> - <artifactId>jctools-core</artifactId> - <version>1.0</version> - <!-- <version>1.1-SNAPSHOT</version> --> + <groupId>com.puppycrawl.tools</groupId> + <artifactId>checkstyle</artifactId> + <version>6.5</version> </dependency> <dependency> @@ -206,28 +225,28 @@ </plugin> <!-- Checkstyle --> - <!-- <plugin> --> - <!-- <groupId>org.apache.maven.plugins</groupId> --> - <!-- <artifactId>maven-checkstyle-plugin</artifactId> --> - <!-- <version>2.12</version> --> - <!-- <executions> --> - <!-- <execution> --> - <!-- <phase>test</phase> --> - <!-- <goals> --> - <!-- <goal>check</goal> --> - <!-- </goals> --> - <!-- <configuration> --> - <!-- <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> --> - <!-- <includeTestSourceDirectory>true</includeTestSourceDirectory> --> - <!-- <encoding>UTF-8</encoding> --> - <!-- <consoleOutput>true</consoleOutput> --> - <!-- <failsOnError>false</failsOnError> --> - <!-- <failOnViolation>false</failOnViolation> --> - <!-- <linkXRef>false</linkXRef> --> - <!-- </configuration> --> - <!-- </execution> --> - <!-- </executions> --> - <!-- </plugin> --> +<!-- <plugin> --> +<!-- <groupId>org.apache.maven.plugins</groupId> --> +<!-- <artifactId>maven-checkstyle-plugin</artifactId> --> +<!-- <version>2.15</version> --> +<!-- <executions> --> +<!-- <execution> --> +<!-- <phase>test</phase> --> +<!-- <goals> --> +<!-- <goal>check</goal> --> +<!-- </goals> --> +<!-- <configuration> --> +<!-- <configLocation>${project.basedir}/conf/quality-config/cs-conf.xml</configLocation> --> +<!-- <includeTestSourceDirectory>true</includeTestSourceDirectory> --> +<!-- <encoding>UTF-8</encoding> --> +<!-- <consoleOutput>true</consoleOutput> --> +<!-- <failsOnError>false</failsOnError> --> +<!-- <failOnViolation>false</failOnViolation> --> +<!-- <linkXRef>false</linkXRef> --> +<!-- </configuration> --> +<!-- </execution> --> +<!-- </executions> --> +<!-- </plugin> --> <!-- Findbugs --> <plugin> @@ -315,7 +334,7 @@ <configuration> <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header> <properties> - <owner>TeeTime</owner> + <owner>Christian Wulf, Nelson Tavares de Sousa</owner> <email>http://teetime.sourceforge.net</email> </properties> <includes> diff --git a/src/main/java/org/jctools/queues/ObservableSpScArrayQueue.java b/src/main/java/org/jctools/queues/ObservableSpScArrayQueue.java deleted file mode 100644 index 01b1bfadfb33c3b6f8600d69e8e9f819fe31e3ad..0000000000000000000000000000000000000000 --- a/src/main/java/org/jctools/queues/ObservableSpScArrayQueue.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 org.jctools.queues; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Queue; - -public final class ObservableSpScArrayQueue<E> implements Queue<E> { - - private final SpscArrayQueue<E> queue; - - private transient long lastProducerIndex, lastConsumerIndex; - - public ObservableSpScArrayQueue(final int requestedCapacity) { - this.queue = new SpscArrayQueue<E>(requestedCapacity); - } - - public long getNumPushes() { - return queue.lvProducerIndex(); - } - - public long getNumPulls() { - return queue.lvConsumerIndex(); - } - - public long getProducerFrequency() { - final long currentProducerIndex = queue.lvProducerIndex(); - long diff = currentProducerIndex - lastProducerIndex; - lastProducerIndex = currentProducerIndex; - return diff; - } - - public long getConsumerFrequency() { - final long currentConsumerIndex = queue.lvConsumerIndex(); - long diff = currentConsumerIndex - lastConsumerIndex; - lastConsumerIndex = currentConsumerIndex; - return diff; - } - - @Override - public int hashCode() { - return queue.hashCode(); - } - - @Override - public boolean add(final E e) { - return queue.add(e); - } - - @Override - public boolean isEmpty() { - return queue.isEmpty(); - } - - @Override - public boolean contains(final Object o) { - return queue.contains(o); - } - - @Override - public E remove() { - return queue.remove(); - } - - @Override - public Object[] toArray() { - return queue.toArray(); - } - - @Override - public boolean equals(final Object obj) { - if (obj instanceof ObservableSpScArrayQueue) { - return queue.equals(((ObservableSpScArrayQueue<?>) obj).queue); - } - return false; - } - - @Override - public E element() { - return queue.element(); - } - - @Override - public boolean offer(final E e) { - return queue.offer(e); - } - - @Override - public <T> T[] toArray(final T[] a) { - return queue.toArray(a); - } - - @Override - public boolean addAll(final Collection<? extends E> c) { - return queue.addAll(c); - } - - @Override - public E poll() { - return queue.poll(); - } - - @Override - public E peek() { - return queue.peek(); - } - - @Override - public int size() { - return queue.size(); - } - - @Override - public Iterator<E> iterator() { - return queue.iterator(); - } - - @Override - public void clear() { - queue.clear(); - } - - @Override - public boolean remove(final Object o) { - return queue.remove(o); - } - - @Override - public boolean containsAll(final Collection<?> c) { - return queue.containsAll(c); - } - - @Override - public boolean removeAll(final Collection<?> c) { - return queue.removeAll(c); - } - - @Override - public boolean retainAll(final Collection<?> c) { - return queue.retainAll(c); - } - - @Override - public String toString() { - return queue.toString(); - } - -} diff --git a/src/main/java/teetime/framework/AbstractCompositeStage.java b/src/main/java/teetime/framework/AbstractCompositeStage.java index d430d233f9933104c9e62bd9fd22a85e569755ed..44b10e6548bc3c431528d1fe50de4ef939b32783 100644 --- a/src/main/java/teetime/framework/AbstractCompositeStage.java +++ b/src/main/java/teetime/framework/AbstractCompositeStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,12 @@ */ package teetime.framework; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.PipeFactoryRegistry; @@ -32,15 +36,19 @@ import teetime.framework.validation.InvalidPortConnection; * @author Christian Wulf, Nelson Tavares de Sousa * */ -@SuppressWarnings("PMD.AbstractNaming") public abstract class AbstractCompositeStage extends Stage { private static final IPipeFactory INTRA_PIPE_FACTORY = PipeFactoryRegistry.INSTANCE .getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); + private final Set<Stage> containingStages = new HashSet<Stage>(); + private final Set<Stage> lastStages = new HashSet<Stage>(); + protected abstract Stage getFirstStage(); - protected abstract Collection<? extends Stage> getLastStages(); + protected final Collection<? extends Stage> getLastStages() { + return lastStages; + } @Override protected final void executeStage() { @@ -72,6 +80,15 @@ public abstract class AbstractCompositeStage extends Stage { return getFirstStage().getInputPorts(); } + @Override + protected OutputPort<?>[] getOutputPorts() { + List<OutputPort<?>> outputPorts = new ArrayList<OutputPort<?>>(); + for (final Stage s : getLastStages()) { + outputPorts.addAll(Arrays.asList(s.getOutputPorts())); + } + return outputPorts.toArray(new OutputPort[0]); + } + @Override public final StageState getCurrentState() { return getFirstStage().getCurrentState(); @@ -90,8 +107,10 @@ public abstract class AbstractCompositeStage extends Stage { super.setOwningThread(owningThread); } - protected static <T> void connectStages(final OutputPort<? extends T> out, final InputPort<T> in) { + protected <T> void connectStages(final OutputPort<? extends T> out, final InputPort<T> in) { INTRA_PIPE_FACTORY.create(out, in); + containingStages.add(out.getOwningStage()); + containingStages.add(in.getOwningStage()); } @Override @@ -106,6 +125,17 @@ public abstract class AbstractCompositeStage extends Stage { @Override public final void onStarting() throws Exception { + for (Stage stage : containingStages) { + if (stage.getOutputPorts().length == 0) { + lastStages.add(stage); + break; + } + for (OutputPort<?> outputPort : stage.getOutputPorts()) { + if (!containingStages.contains(outputPort.getPipe().getTargetPort().getOwningStage())) { + lastStages.add(stage); + } + } + } getFirstStage().onStarting(); } diff --git a/src/main/java/teetime/framework/AbstractConsumerStage.java b/src/main/java/teetime/framework/AbstractConsumerStage.java index ea6af6e5a01e14097810ed955b3ba56fce2d9895..c8935aa9edb2ab0fe6125035b3e698876be87224 100644 --- a/src/main/java/teetime/framework/AbstractConsumerStage.java +++ b/src/main/java/teetime/framework/AbstractConsumerStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package teetime.framework; +import teetime.framework.exceptionHandling.AbstractExceptionListener.FurtherExecution; import teetime.framework.exceptionHandling.StageException; public abstract class AbstractConsumerStage<I> extends AbstractStage { @@ -35,7 +36,10 @@ public abstract class AbstractConsumerStage<I> extends AbstractStage { try { this.execute(element); } catch (Exception e) { - throw new StageException(e, this); + final FurtherExecution furtherExecution = exceptionHandler.onStageException(e, this); + if (furtherExecution == FurtherExecution.TERMINATE) { + throw new StageException(e, this); + } } } diff --git a/src/main/java/teetime/framework/AbstractInterThreadPipe.java b/src/main/java/teetime/framework/AbstractInterThreadPipe.java index 6c3e30615fb06c0ec9d80093a76232f6775ad02c..4deee9e7b64f5eb96fbf393e55cc879b2ca0c023 100644 --- a/src/main/java/teetime/framework/AbstractInterThreadPipe.java +++ b/src/main/java/teetime/framework/AbstractInterThreadPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/AbstractIntraThreadPipe.java b/src/main/java/teetime/framework/AbstractIntraThreadPipe.java index 47f3af1d875c0ffbbb6140d1929d2e5793d28671..92fe284b21c74a10efe6b84be454639acbd59348 100644 --- a/src/main/java/teetime/framework/AbstractIntraThreadPipe.java +++ b/src/main/java/teetime/framework/AbstractIntraThreadPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/AbstractPipe.java b/src/main/java/teetime/framework/AbstractPipe.java index e0642ea8aa824667aaead75bfa89f94374965260..7485f8d45b6796a5f94bf853d526cbb009f8da8f 100644 --- a/src/main/java/teetime/framework/AbstractPipe.java +++ b/src/main/java/teetime/framework/AbstractPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/AbstractPort.java b/src/main/java/teetime/framework/AbstractPort.java index 0eaeffb3c6198ebdfeaaaf8b04a6ba48d7f1a7d5..0725cbe873fce302ffdcb462df3c28d7506ebb69 100644 --- a/src/main/java/teetime/framework/AbstractPort.java +++ b/src/main/java/teetime/framework/AbstractPort.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,12 @@ public abstract class AbstractPort<T> { * </p> */ protected final Class<T> type; + private final Stage owningStage; - public AbstractPort(final Class<T> type) { + public AbstractPort(final Class<T> type, final Stage owningStage) { super(); this.type = type; + this.owningStage = owningStage; } public IPipe getPipe() { @@ -44,4 +46,8 @@ public abstract class AbstractPort<T> { public Class<T> getType() { return this.type; } + + public final Stage getOwningStage() { + return owningStage; + } } diff --git a/src/main/java/teetime/framework/AbstractProducerStage.java b/src/main/java/teetime/framework/AbstractProducerStage.java index 8806184c736014e706f9113f0a76baf9cbd2f337..8ee88e594d98c843eaddd0e5c0ed397de0b548e3 100644 --- a/src/main/java/teetime/framework/AbstractProducerStage.java +++ b/src/main/java/teetime/framework/AbstractProducerStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package teetime.framework; +import teetime.framework.exceptionHandling.AbstractExceptionListener.FurtherExecution; import teetime.framework.exceptionHandling.StageException; /** @@ -39,7 +40,10 @@ public abstract class AbstractProducerStage<O> extends AbstractStage { try { this.execute(); } catch (Exception e) { - throw new StageException(e, this); + final FurtherExecution furtherExecution = this.exceptionHandler.onStageException(e, this); + if (furtherExecution == FurtherExecution.TERMINATE) { + throw new StageException(e, this); + } } } diff --git a/src/main/java/teetime/framework/AbstractRunnableStage.java b/src/main/java/teetime/framework/AbstractRunnableStage.java index 2fa5456617c2922b3fdbc6a09e0e01b068701456..a5d537c2c89629975cfbdb6d62801bda249e010b 100644 --- a/src/main/java/teetime/framework/AbstractRunnableStage.java +++ b/src/main/java/teetime/framework/AbstractRunnableStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,24 +19,19 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import teetime.framework.exceptionHandling.StageException; -import teetime.framework.exceptionHandling.StageExceptionHandler; -import teetime.framework.exceptionHandling.StageExceptionHandler.FurtherExecution; import teetime.framework.signal.TerminatingSignal; abstract class AbstractRunnableStage implements Runnable { - private final StageExceptionHandler exceptionHandler; - private static final String TERMINATING_THREAD_DUE_TO_THE_FOLLOWING_EXCEPTION = "Terminating thread due to the following exception: "; private final Stage stage; @SuppressWarnings("PMD.LoggerIsNotStaticFinal") protected final Logger logger; - public AbstractRunnableStage(final Stage stage, final StageExceptionHandler exceptionHandler) { + public AbstractRunnableStage(final Stage stage) { this.stage = stage; this.logger = LoggerFactory.getLogger(stage.getClass()); - this.exceptionHandler = exceptionHandler; } @Override @@ -45,19 +40,14 @@ abstract class AbstractRunnableStage implements Runnable { boolean failed = false; try { beforeStageExecution(stage); - - do { - try { + try { + do { executeStage(stage); - } catch (StageException e) { - final FurtherExecution furtherExecution = this.exceptionHandler.onStageException(e, e.getThrowingStage()); - if (furtherExecution == FurtherExecution.TERMINATE) { - this.stage.terminate(); - failed = true; - } - } - } while (!stage.shouldBeTerminated()); - + } while (!stage.shouldBeTerminated()); + } catch (StageException e) { + this.stage.terminate(); + failed = true; + } afterStageExecution(stage); } catch (RuntimeException e) { @@ -87,4 +77,5 @@ abstract class AbstractRunnableStage implements Runnable { protected abstract void executeStage(Stage stage); protected abstract void afterStageExecution(Stage stage); + } diff --git a/src/main/java/teetime/framework/AbstractStage.java b/src/main/java/teetime/framework/AbstractStage.java index 2e69cff7d8fd68a8765e6fd84a615f3ef6f63be8..f2621622998c198bd69ffd3efe52a4fb581fe999 100644 --- a/src/main/java/teetime/framework/AbstractStage.java +++ b/src/main/java/teetime/framework/AbstractStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ package teetime.framework; -import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -29,31 +29,20 @@ public abstract class AbstractStage extends Stage { private static final IPipe DUMMY_PORT = new DummyPipe(); - private final List<InputPort<?>> inputPortList = new ArrayList<InputPort<?>>(); - private final List<OutputPort<?>> outputPortList = new ArrayList<OutputPort<?>>(); private final Set<ISignal> triggeredSignals = new HashSet<ISignal>(); - /** A cached instance of <code>inputPortList</code> to avoid creating an iterator each time iterating it */ - protected InputPort<?>[] cachedInputPorts = new InputPort[0]; - /** A cached instance of <code>outputPortList</code> to avoid creating an iterator each time iterating it */ - protected OutputPort<?>[] cachedOutputPorts; - /** The current state of this stage */ + private InputPort<?>[] inputPorts = new InputPort<?>[0]; + private OutputPort<?>[] outputPorts = new OutputPort<?>[0]; private StageState currentState = StageState.CREATED; - /** - * @return the stage's input ports - */ @Override public InputPort<?>[] getInputPorts() { - // return this.cachedInputPorts; - return inputPortList.toArray(new InputPort<?>[0]); // FIXME remove work-around + return inputPorts; } - /** - * @return the stage's output ports - */ + @Override protected OutputPort<?>[] getOutputPorts() { - return this.cachedOutputPorts; + return this.outputPorts; } @Override @@ -70,7 +59,7 @@ public abstract class AbstractStage extends Stage { if (!this.signalAlreadyReceived(signal, inputPort)) { signal.trigger(this); - for (OutputPort<?> outputPort : outputPortList) { + for (OutputPort<?> outputPort : outputPorts) { outputPort.sendSignal(signal); } } @@ -108,8 +97,6 @@ public abstract class AbstractStage extends Stage { @Override public void onStarting() throws Exception { this.owningThread = Thread.currentThread(); - this.cachedInputPorts = this.inputPortList.toArray(new InputPort<?>[0]); - this.cachedOutputPorts = this.outputPortList.toArray(new OutputPort<?>[0]); this.connectUnconnectedOutputPorts(); currentState = StageState.STARTED; @@ -118,7 +105,7 @@ public abstract class AbstractStage extends Stage { @SuppressWarnings("PMD.DataflowAnomalyAnalysis") private void connectUnconnectedOutputPorts() { - for (OutputPort<?> outputPort : this.cachedOutputPorts) { + for (OutputPort<?> outputPort : this.outputPorts) { if (null == outputPort.getPipe()) { // if port is unconnected if (logger.isInfoEnabled()) { this.logger.info("Unconnected output port: " + outputPort + ". Connecting with a dummy output port."); @@ -156,7 +143,7 @@ public abstract class AbstractStage extends Stage { */ protected <T> InputPort<T> createInputPort(final Class<T> type) { final InputPort<T> inputPort = new InputPort<T>(type, this); - this.inputPortList.add(inputPort); + inputPorts = addElementToArray(inputPort, inputPorts); return inputPort; } @@ -180,16 +167,21 @@ public abstract class AbstractStage extends Stage { * @return Newly added OutputPort */ protected <T> OutputPort<T> createOutputPort(final Class<T> type) { - final OutputPort<T> outputPort = new OutputPort<T>(type); - this.outputPortList.add(outputPort); + final OutputPort<T> outputPort = new OutputPort<T>(type, this); + outputPorts = addElementToArray(outputPort, outputPorts); return outputPort; } + private <T> T[] addElementToArray(final T element, final T[] srcArray) { + T[] newOutputPorts = Arrays.copyOf(srcArray, srcArray.length + 1); + newOutputPorts[srcArray.length] = element; + return newOutputPorts; + } + @SuppressWarnings("PMD.DataflowAnomalyAnalysis") @Override public void validateOutputPorts(final List<InvalidPortConnection> invalidPortConnections) { - // for (OutputPort<?> outputPort : this.getOutputPorts()) { - for (OutputPort<?> outputPort : this.outputPortList) { + for (OutputPort<?> outputPort : outputPorts) { final IPipe pipe = outputPort.getPipe(); if (null != pipe) { // if output port is connected with another one final Class<?> sourcePortType = outputPort.getType(); diff --git a/src/main/java/teetime/framework/Analysis.java b/src/main/java/teetime/framework/Analysis.java index 42484554c5a287a58f3c53e819a4ab29b4038097..7ae760cb15cf3cea4b7a63a59cbfb2a5eeddcc66 100644 --- a/src/main/java/teetime/framework/Analysis.java +++ b/src/main/java/teetime/framework/Analysis.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,13 +19,15 @@ import java.lang.Thread.UncaughtExceptionHandler; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import teetime.framework.exceptionHandling.IgnoringStageListener; -import teetime.framework.exceptionHandling.StageExceptionHandler; +import teetime.framework.exceptionHandling.AbstractExceptionListener; +import teetime.framework.exceptionHandling.IExceptionListenerFactory; +import teetime.framework.exceptionHandling.IgnoringExceptionListenerFactory; import teetime.framework.signal.ValidatingSignal; import teetime.framework.validation.AnalysisNotValidException; import teetime.util.Pair; @@ -34,16 +36,19 @@ import teetime.util.Pair; * Represents an Analysis to which stages can be added and executed later. * This needs a {@link AnalysisConfiguration}, * in which the adding and configuring of stages takes place. - * To start the analysis {@link #execute()} needs to be executed. + * To start the analysis {@link #executeBlocking()} needs to be executed. * This class will automatically create threads and join them without any further commitment. + * + * @param <T> + * the type of the {@link AnalysisConfiguration} */ -public final class Analysis implements UncaughtExceptionHandler { +public final class Analysis<T extends AnalysisConfiguration> implements UncaughtExceptionHandler { private static final Logger LOGGER = LoggerFactory.getLogger(Analysis.class); - private final AnalysisConfiguration configuration; + private final T configuration; - private final Class<? extends teetime.framework.exceptionHandling.StageExceptionHandler> listener; + private final IExceptionListenerFactory factory; private boolean executionInterrupted = false; @@ -61,14 +66,14 @@ public final class Analysis implements UncaughtExceptionHandler { * @param configuration * to be used for the analysis */ - public Analysis(final AnalysisConfiguration configuration) { - this(configuration, false, IgnoringStageListener.class); + public Analysis(final T configuration) { + this(configuration, false, new IgnoringExceptionListenerFactory()); } @SuppressWarnings("PMD.ConstructorCallsOverridableMethod") // TODO remove @SuppressWarnings if init is no longer deprecated - public Analysis(final AnalysisConfiguration configuration, final boolean validationEnabled) { - this(configuration, validationEnabled, IgnoringStageListener.class); + public Analysis(final T configuration, final boolean validationEnabled) { + this(configuration, validationEnabled, new IgnoringExceptionListenerFactory()); } /** @@ -76,16 +81,16 @@ public final class Analysis implements UncaughtExceptionHandler { * * @param configuration * to be used for the analysis - * @param listener + * @param factory * specific listener for the exception handling */ - public Analysis(final AnalysisConfiguration configuration, final Class<? extends StageExceptionHandler> listener) { - this(configuration, false, listener); + public Analysis(final T configuration, final IExceptionListenerFactory factory) { + this(configuration, false, factory); } - public Analysis(final AnalysisConfiguration configuration, final boolean validationEnabled, final Class<? extends StageExceptionHandler> listener) { + public Analysis(final T configuration, final boolean validationEnabled, final IExceptionListenerFactory factory) { this.configuration = configuration; - this.listener = listener; + this.factory = factory; if (validationEnabled) { validateStages(); } @@ -108,9 +113,9 @@ public final class Analysis implements UncaughtExceptionHandler { } /** - * This initializes Analysis and needs to be run right before starting it. + * This initializes the analysis and needs to be run right before starting it. * - * @deprecated since 1.1 + * @deprecated since 1.1, analysis will be initialized automatically by the framework */ @Deprecated public final void init() { @@ -123,37 +128,28 @@ public final class Analysis implements UncaughtExceptionHandler { if (threadableStageJobs.isEmpty()) { throw new IllegalStateException("No stage was added using the addThreadableStage(..) method. Add at least one stage."); } + AbstractExceptionListener newListener; + Set<Stage> intraStages; for (Stage stage : threadableStageJobs) { - StageExceptionHandler newListener; - try { - newListener = listener.newInstance(); - } catch (InstantiationException e) { - throw new IllegalStateException(e); - } catch (IllegalAccessException e) { - throw new IllegalStateException(e); - } + intraStages = traverseIntraStages(stage); + newListener = factory.create(); switch (stage.getTerminationStrategy()) { case BY_SIGNAL: { - final Thread thread = new Thread(new RunnableConsumerStage(stage, newListener)); - stage.setOwningThread(thread); + final RunnableConsumerStage runnable = new RunnableConsumerStage(stage); + final Thread thread = createThread(newListener, intraStages, stage, runnable); this.consumerThreads.add(thread); - thread.setName(stage.getId()); break; } case BY_SELF_DECISION: { - RunnableProducerStage runnable = new RunnableProducerStage(stage, newListener); - final Thread thread = new Thread(runnable); - stage.setOwningThread(thread); + final RunnableProducerStage runnable = new RunnableProducerStage(stage); + final Thread thread = createThread(newListener, intraStages, stage, runnable); this.finiteProducerThreads.add(thread); - thread.setName(stage.getId()); break; } case BY_INTERRUPT: { - RunnableProducerStage runnable = new RunnableProducerStage(stage, newListener); - final Thread thread = new Thread(runnable); - stage.setOwningThread(thread); + final RunnableProducerStage runnable = new RunnableProducerStage(stage); + final Thread thread = createThread(newListener, intraStages, stage, runnable); this.infiniteProducerThreads.add(thread); - thread.setName(stage.getId()); break; } default: @@ -163,12 +159,23 @@ public final class Analysis implements UncaughtExceptionHandler { } + private Thread createThread(final AbstractExceptionListener newListener, final Set<Stage> intraStages, final Stage stage, final AbstractRunnableStage runnable) { + final Thread thread = new Thread(runnable); + for (Stage intraStage : intraStages) { + intraStage.setOwningThread(thread); + intraStage.setExceptionHandler(newListener); + } + thread.setUncaughtExceptionHandler(this); + thread.setName(stage.getId()); + return thread; + } + /** * This method will start the Analysis and all containing stages. * * @return a collection of thread/throwable pairs * - * @deprecated since 1.1, replaced by {@link #execute()} + * @deprecated since 1.1, replaced by {@link #executeBlocking()} */ @Deprecated public Collection<Pair<Thread, Throwable>> start() { @@ -200,28 +207,89 @@ public final class Analysis implements UncaughtExceptionHandler { for (Thread thread : this.infiniteProducerThreads) { thread.interrupt(); } - return this.exceptions; } /** - * This method will start the Analysis and all containing stages. + * Calling this method will block the current thread, until the analysis terminates. * * @throws AnalysisException * if at least one exception in one thread has occurred within the analysis. The exception contains the pairs of thread and throwable * * @since 1.1 */ - public void execute() { - start(); + public void waitForTermination() { + + try { + for (Thread thread : this.finiteProducerThreads) { + thread.join(); + } + + for (Thread thread : this.consumerThreads) { + thread.join(); + } + } catch (InterruptedException e) { + LOGGER.error("Analysis has stopped unexpectedly", e); + for (Thread thread : this.finiteProducerThreads) { + thread.interrupt(); + } + + for (Thread thread : this.consumerThreads) { + thread.interrupt(); + } + } + + for (Thread thread : this.infiniteProducerThreads) { + thread.interrupt(); + } + if (!exceptions.isEmpty()) { throw new AnalysisException(exceptions); } } + // TODO: implement + private void abortEventually() { + for (Thread thread : this.finiteProducerThreads) { + thread.interrupt(); + } + + for (Thread thread : this.consumerThreads) { + thread.interrupt(); + } + + for (Thread thread : this.infiniteProducerThreads) { + thread.interrupt(); + } + } + + /** + * This method will start the Analysis and block until it is finished. + * + * @throws AnalysisException + * if at least one exception in one thread has occurred within the analysis. The exception contains the pairs of thread and throwable + * + * @since 1.1 + */ + public void executeBlocking() { + executeNonBlocking(); + waitForTermination(); + } + + /** + * This method starts the analysis without waiting for its termination. The method {@link #waitForTermination()} must be called to unsure a correct termination + * of the analysis. + * + * @since 1.1 + */ + public void executeNonBlocking() { + startThreads(this.consumerThreads); + startThreads(this.finiteProducerThreads); + startThreads(this.infiniteProducerThreads); + } + private void startThreads(final Iterable<Thread> threads) { for (Thread thread : threads) { - thread.setUncaughtExceptionHandler(this); thread.start(); } } @@ -231,7 +299,7 @@ public final class Analysis implements UncaughtExceptionHandler { * * @return the configuration used for the Analysis */ - public AnalysisConfiguration getConfiguration() { + public T getConfiguration() { return this.configuration; } @@ -250,4 +318,10 @@ public final class Analysis implements UncaughtExceptionHandler { } this.exceptions.add(Pair.of(thread, throwable)); } + + private Set<Stage> traverseIntraStages(final Stage stage) { + final Traversor traversor = new Traversor(new IntraStageCollector()); + traversor.traverse(stage); + return traversor.getVisitedStage(); + } } diff --git a/src/main/java/teetime/framework/AnalysisConfiguration.java b/src/main/java/teetime/framework/AnalysisConfiguration.java index 71441436e1e9843d18dc7142843ca79f9a0b7562..23a784ec6b5213813ef753d100dbc6be3342f5d8 100644 --- a/src/main/java/teetime/framework/AnalysisConfiguration.java +++ b/src/main/java/teetime/framework/AnalysisConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,11 @@ package teetime.framework; import java.util.LinkedList; import java.util.List; +import teetime.framework.pipe.IPipe; +import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.PipeFactoryRegistry; +import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; +import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; /** * Represents a configuration of connected stages, which is needed to run a analysis. @@ -26,11 +30,18 @@ import teetime.framework.pipe.PipeFactoryRegistry; */ public abstract class AnalysisConfiguration { + private final List<Stage> threadableStageJobs = new LinkedList<Stage>(); + /** * Can be used by subclasses, to obtain pipe factories */ + @Deprecated + // TODO: set private protected static final PipeFactoryRegistry PIPE_FACTORY_REGISTRY = PipeFactoryRegistry.INSTANCE; - private final List<Stage> threadableStageJobs = new LinkedList<Stage>(); + + private final static IPipeFactory intraThreadFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); + private final static IPipeFactory interBoundedThreadFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, true); + private final static IPipeFactory interUnboundedThreadFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, false); List<Stage> getThreadableStageJobs() { return this.threadableStageJobs; @@ -40,10 +51,72 @@ public abstract class AnalysisConfiguration { * Execute this method, to add a stage to the configuration, which should be executed in a own thread. * * @param stage - * A arbitrary stage, which will be added to the configuration und executed in a thread. + * A arbitrary stage, which will be added to the configuration and executed in a thread. */ protected void addThreadableStage(final Stage stage) { this.threadableStageJobs.add(stage); } + /** + * Connects two stages with a pipe within the same thread. + * + * @param sourcePort + * @param targetPort + * @return + * the pipe instance which connects the two given stages + */ + protected static <T> IPipe connectIntraThreads(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { + return intraThreadFactory.create(sourcePort, targetPort); + } + + /** + * Connects two stages with a bounded pipe within two separate threads. + * + * @param sourcePort + * @param targetPort + * @return + * the pipe instance which connects the two given stages + */ + protected static <T> IPipe connectBoundedInterThreads(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { + return interBoundedThreadFactory.create(sourcePort, targetPort); + } + + /** + * Connects two stages with a unbounded pipe within two separate threads. + * + * @param sourcePort + * @param targetPort + * @return + * the pipe instance which connects the two given stages + */ + protected static <T> IPipe connectUnboundedInterThreads(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) { + return interUnboundedThreadFactory.create(sourcePort, targetPort); + } + + /** + * Connects two stages with a bounded pipe within two separate threads. + * + * @param sourcePort + * @param targetPort + * @param capacity + * capacity of the underlying queue + * @return + */ + protected static <T> IPipe connectBoundedInterThreads(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) { + return interBoundedThreadFactory.create(sourcePort, targetPort, capacity); + } + + /** + * Connects two stages with a unbounded pipe within two separate threads. + * + * @param sourcePort + * @param targetPort + * @param capacity + * capacity of the underlying queue + * @return + */ + protected static <T> IPipe connectUnboundedInterThreads(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort, final int capacity) { + return interUnboundedThreadFactory.create(sourcePort, targetPort, capacity); + } + } diff --git a/src/main/java/teetime/framework/AnalysisException.java b/src/main/java/teetime/framework/AnalysisException.java index cdaa9d59fddcec8d456f19164424506f8e2a241b..90fcdcf73d6bc1f2c48f95efa2480b441fbf04d0 100644 --- a/src/main/java/teetime/framework/AnalysisException.java +++ b/src/main/java/teetime/framework/AnalysisException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/performancetest/java/teetime/framework/OldHeadPipeline.java b/src/main/java/teetime/framework/IPipeVisitor.java similarity index 68% rename from src/performancetest/java/teetime/framework/OldHeadPipeline.java rename to src/main/java/teetime/framework/IPipeVisitor.java index 10a183aa5ffb937be2e4f9d1ad63cb12ec01fdce..00daeaa15d84f7966725948574d32f9c1d1125ce 100644 --- a/src/performancetest/java/teetime/framework/OldHeadPipeline.java +++ b/src/main/java/teetime/framework/IPipeVisitor.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,14 @@ */ package teetime.framework; -@Deprecated -public final class OldHeadPipeline<FirstStage extends Stage, LastStage extends Stage> extends OldPipeline<FirstStage, LastStage> { +import teetime.framework.pipe.IPipe; - public OldHeadPipeline() {} +public interface IPipeVisitor { - public OldHeadPipeline(final String name) {} + public enum VisitorBehavior { + CONTINUE, STOP + } + + VisitorBehavior visit(IPipe outputPipe); } diff --git a/src/main/java/teetime/framework/InputPort.java b/src/main/java/teetime/framework/InputPort.java index 6de51627c26915a33f072174742084dcbeb4458a..2c2fee6f833fd6fc8476962a9ea3cf371845366b 100644 --- a/src/main/java/teetime/framework/InputPort.java +++ b/src/main/java/teetime/framework/InputPort.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,8 @@ package teetime.framework; public final class InputPort<T> extends AbstractPort<T> { - private final Stage owningStage; - InputPort(final Class<T> type, final Stage owningStage) { - super(type); - this.owningStage = owningStage; + super(type, owningStage); } /** @@ -33,10 +30,6 @@ public final class InputPort<T> extends AbstractPort<T> { return (T) this.pipe.removeLast(); } - public Stage getOwningStage() { - return this.owningStage; - } - public boolean isClosed() { return pipe.isClosed() && !pipe.hasMore(); } diff --git a/src/performancetest/java/teetime/examples/HostName.java b/src/main/java/teetime/framework/IntraStageCollector.java similarity index 57% rename from src/performancetest/java/teetime/examples/HostName.java rename to src/main/java/teetime/framework/IntraStageCollector.java index e14872608726132cdf3161c591d117b0d94f319b..fb889d74f3e8ba3ca7b67ff0e64b9db89600b8f0 100644 --- a/src/performancetest/java/teetime/examples/HostName.java +++ b/src/main/java/teetime/framework/IntraStageCollector.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,26 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package teetime.examples; +package teetime.framework; -public enum HostName { +import teetime.framework.pipe.IPipe; - CHW_HOME("Nogge-PC"), - CHW_WORK("chw-PC"), - NIE_WORK("nie-PC"); +public class IntraStageCollector implements IPipeVisitor { - private final String hostName; - - HostName(final String hostName) { - this.hostName = hostName; - } - - public String getHostName() { - return hostName; - } + public IntraStageCollector() {} @Override - public String toString() { - return getHostName(); + public VisitorBehavior visit(final IPipe outputPipe) { + if (outputPipe instanceof AbstractIntraThreadPipe) { + return VisitorBehavior.CONTINUE; + } + return VisitorBehavior.STOP; } + } diff --git a/src/main/java/teetime/framework/MonitoringThread.java b/src/main/java/teetime/framework/MonitoringThread.java index 5ca6287907ddd8b26581ff16b5b4e8db26ff4b68..1bfcbc5e64cc9125f040fc1e9ff33cda15f4c4a9 100644 --- a/src/main/java/teetime/framework/MonitoringThread.java +++ b/src/main/java/teetime/framework/MonitoringThread.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/NotEnoughInputException.java b/src/main/java/teetime/framework/NotEnoughInputException.java index 65f0506ce90bee60610bd55ca334876055db5657..66ed4c5be952dfe539327fa62335b4cffcd7faa6 100644 --- a/src/main/java/teetime/framework/NotEnoughInputException.java +++ b/src/main/java/teetime/framework/NotEnoughInputException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/OutputPort.java b/src/main/java/teetime/framework/OutputPort.java index db50ef1ccae890ae28a8a88e882052c9754ed892..4d23baaad7a2030dd3bbe361f8161b8bb63dca65 100644 --- a/src/main/java/teetime/framework/OutputPort.java +++ b/src/main/java/teetime/framework/OutputPort.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ import teetime.framework.signal.TerminatingSignal; */ public final class OutputPort<T> extends AbstractPort<T> { - OutputPort(final Class<T> type) { - super(type); + OutputPort(final Class<T> type, final Stage owningStage) { + super(type, owningStage); } /** diff --git a/src/main/java/teetime/framework/RunnableConsumerStage.java b/src/main/java/teetime/framework/RunnableConsumerStage.java index 9f7ac0c88521dabf21fcbccf2dd5503149d74652..5a8e39643208d88882ca578bd0a6475813fb1e16 100644 --- a/src/main/java/teetime/framework/RunnableConsumerStage.java +++ b/src/main/java/teetime/framework/RunnableConsumerStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ */ package teetime.framework; -import teetime.framework.exceptionHandling.StageExceptionHandler; import teetime.framework.idle.IdleStrategy; import teetime.framework.idle.YieldStrategy; import teetime.framework.signal.ISignal; @@ -32,12 +31,12 @@ final class RunnableConsumerStage extends AbstractRunnableStage { * @param stage * to execute within an own thread */ - public RunnableConsumerStage(final Stage stage, final StageExceptionHandler exceptionListener) { - this(stage, new YieldStrategy(), exceptionListener); + public RunnableConsumerStage(final Stage stage) { + this(stage, new YieldStrategy()); } - public RunnableConsumerStage(final Stage stage, final IdleStrategy idleStrategy, final StageExceptionHandler exceptionListener) { - super(stage, exceptionListener); + public RunnableConsumerStage(final Stage stage, final IdleStrategy idleStrategy) { + super(stage); this.inputPorts = stage.getInputPorts(); // FIXME should getInputPorts() really be defined in Stage? } diff --git a/src/main/java/teetime/framework/RunnableProducerStage.java b/src/main/java/teetime/framework/RunnableProducerStage.java index e158bda285c233a48c03a79cff53aa925b0bfe59..2b7b556af36be9f5dd00b4c827c48dea1b831dc5 100644 --- a/src/main/java/teetime/framework/RunnableProducerStage.java +++ b/src/main/java/teetime/framework/RunnableProducerStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,24 +15,13 @@ */ package teetime.framework; -import teetime.framework.exceptionHandling.StageExceptionHandler; -import teetime.framework.exceptionHandling.TerminatingStageListener; import teetime.framework.signal.StartingSignal; import teetime.framework.signal.TerminatingSignal; public final class RunnableProducerStage extends AbstractRunnableStage { - /** - * Uses the {@link TerminatingStageListener} as default exception handler - * - * @param stage - */ public RunnableProducerStage(final Stage stage) { - super(stage, new TerminatingStageListener()); - } - - public RunnableProducerStage(final Stage stage, final StageExceptionHandler handler) { - super(stage, handler); + super(stage); } @Override diff --git a/src/main/java/teetime/framework/Stage.java b/src/main/java/teetime/framework/Stage.java index c87593b7eac23b14790ce9f2939fb3d1a4484ed0..ab567e82c71e7ed2fde7ce84aa5786be93671c49 100644 --- a/src/main/java/teetime/framework/Stage.java +++ b/src/main/java/teetime/framework/Stage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import teetime.framework.exceptionHandling.AbstractExceptionListener; import teetime.framework.signal.ISignal; import teetime.framework.validation.InvalidPortConnection; @@ -42,6 +43,8 @@ public abstract class Stage { @SuppressWarnings("PMD.LoggerIsNotStaticFinal") protected final Logger logger; + protected AbstractExceptionListener exceptionHandler; + /** The owning thread of this stage if this stage is directly executed by a {@link AbstractRunnableStage}, <code>null</code> otherwise. */ protected Thread owningThread; @@ -119,6 +122,8 @@ public abstract class Stage { protected abstract InputPort<?>[] getInputPorts(); + protected abstract OutputPort<?>[] getOutputPorts(); + // events public abstract void onValidating(List<InvalidPortConnection> invalidPortConnections); @@ -129,4 +134,7 @@ public abstract class Stage { @SuppressWarnings("PMD.SignatureDeclareThrowsException") public abstract void onTerminating() throws Exception; + protected final void setExceptionHandler(final AbstractExceptionListener exceptionHandler) { + this.exceptionHandler = exceptionHandler; + } } diff --git a/src/main/java/teetime/framework/StageState.java b/src/main/java/teetime/framework/StageState.java index 99cfd922f06f64e42de4a98ed1f11ef75c1730cf..cb32ff6400432a05347f7591d0d3ef36daf745d8 100644 --- a/src/main/java/teetime/framework/StageState.java +++ b/src/main/java/teetime/framework/StageState.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/TerminateException.java b/src/main/java/teetime/framework/TerminateException.java index 14126b63ac742adbfce506922cca8a32afa30507..8ff02de7e821080422b2363be6ea24146cc4c1d8 100644 --- a/src/main/java/teetime/framework/TerminateException.java +++ b/src/main/java/teetime/framework/TerminateException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/TerminationStrategy.java b/src/main/java/teetime/framework/TerminationStrategy.java index 00d187854d4a8e66cbdf98716210303ee93efc89..bd61f3349f71ea5c0b9b1ee617b6de34315bd8e3 100644 --- a/src/main/java/teetime/framework/TerminationStrategy.java +++ b/src/main/java/teetime/framework/TerminationStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/Traversor.java b/src/main/java/teetime/framework/Traversor.java new file mode 100644 index 0000000000000000000000000000000000000000..82ac218e31b10d93a25de53ead1f845b94a333c5 --- /dev/null +++ b/src/main/java/teetime/framework/Traversor.java @@ -0,0 +1,51 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework; + +import java.util.HashSet; +import java.util.Set; + +import teetime.framework.IPipeVisitor.VisitorBehavior; +import teetime.framework.pipe.IPipe; + +public class Traversor { + + private final IPipeVisitor pipeVisitor; + private final Set<Stage> visitedStage = new HashSet<Stage>(); + + public Traversor(final IPipeVisitor pipeVisitor) { + this.pipeVisitor = pipeVisitor; + } + + public void traverse(final Stage stage) { + if (!visitedStage.add(stage)) { + return; + } + + OutputPort<?>[] outputPorts = stage.getOutputPorts(); + for (OutputPort<?> outputPort : outputPorts) { + IPipe pipe = outputPort.getPipe(); + if (null != pipe && pipeVisitor.visit(pipe) == VisitorBehavior.CONTINUE) { + Stage owningStage = pipe.getTargetPort().getOwningStage(); + traverse(owningStage); // recursive call + } + } + } + + public Set<Stage> getVisitedStage() { + return visitedStage; + } +} diff --git a/src/main/java/teetime/framework/exceptionHandling/StageExceptionHandler.java b/src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java similarity index 89% rename from src/main/java/teetime/framework/exceptionHandling/StageExceptionHandler.java rename to src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java index db74db24d69a7cb287fc3eb9a191ad8850217469..8cbc63dd6a2fd7d692e3c590fff49f9bd17ed0a0 100644 --- a/src/main/java/teetime/framework/exceptionHandling/StageExceptionHandler.java +++ b/src/main/java/teetime/framework/exceptionHandling/AbstractExceptionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import teetime.framework.Stage; * Represent a minimalistic StageExceptionListener. Listener which extend from this one, must a least implement this functionality. * This abstract class provides a Logger {@link #logger} and a method to terminate the threads execution {@link #terminateExecution()}. */ -public abstract class StageExceptionHandler { +public abstract class AbstractExceptionListener { public enum FurtherExecution { CONTINUE, TERMINATE @@ -35,7 +35,7 @@ public abstract class StageExceptionHandler { */ protected final Logger logger; - public StageExceptionHandler() { + public AbstractExceptionListener() { this.logger = LoggerFactory.getLogger(this.getClass().getCanonicalName()); } diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyNoopFilter.java b/src/main/java/teetime/framework/exceptionHandling/IExceptionListenerFactory.java similarity index 68% rename from src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyNoopFilter.java rename to src/main/java/teetime/framework/exceptionHandling/IExceptionListenerFactory.java index f9781c6c4b9a4d1472a58fa4df8a8445c1d6315c..4afd82d959b1905e2801533ba7cf8799d775d803 100644 --- a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyNoopFilter.java +++ b/src/main/java/teetime/framework/exceptionHandling/IExceptionListenerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,17 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package teetime.examples.experiment01.legacystage; +package teetime.framework.exceptionHandling; -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class LegacyNoopFilter<T> { +public interface IExceptionListenerFactory { - public T execute(final T element) { - return element; - } + public AbstractExceptionListener create(); } diff --git a/src/main/java/teetime/framework/exceptionHandling/IgnoringStageListener.java b/src/main/java/teetime/framework/exceptionHandling/IgnoringExceptionListener.java similarity index 81% rename from src/main/java/teetime/framework/exceptionHandling/IgnoringStageListener.java rename to src/main/java/teetime/framework/exceptionHandling/IgnoringExceptionListener.java index 3ecc69411165858f3b264a56d79bab6246169ef0..71499e81bdfc3b965c5fecd92ab58f82e12b2b5f 100644 --- a/src/main/java/teetime/framework/exceptionHandling/IgnoringStageListener.java +++ b/src/main/java/teetime/framework/exceptionHandling/IgnoringExceptionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,7 @@ package teetime.framework.exceptionHandling; import teetime.framework.Stage; -public class IgnoringStageListener extends StageExceptionHandler { - - public IgnoringStageListener() { - super(); - } +class IgnoringExceptionListener extends AbstractExceptionListener { @Override public FurtherExecution onStageException(final Exception e, final Stage throwingStage) { diff --git a/src/main/java/teetime/framework/exceptionHandling/IgnoringExceptionListenerFactory.java b/src/main/java/teetime/framework/exceptionHandling/IgnoringExceptionListenerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..b08fb3a4a4244ab97229c8e60dff481affcead5a --- /dev/null +++ b/src/main/java/teetime/framework/exceptionHandling/IgnoringExceptionListenerFactory.java @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework.exceptionHandling; + +public class IgnoringExceptionListenerFactory implements IExceptionListenerFactory { + + @Override + public AbstractExceptionListener create() { + return new IgnoringExceptionListener(); + } + +} diff --git a/src/main/java/teetime/framework/exceptionHandling/LoggingStageListener.java b/src/main/java/teetime/framework/exceptionHandling/LoggingExceptionListener.java similarity index 77% rename from src/main/java/teetime/framework/exceptionHandling/LoggingStageListener.java rename to src/main/java/teetime/framework/exceptionHandling/LoggingExceptionListener.java index 0324da7f3b473aeaae691503ae509afd8f6961ba..53dce3295a0b561e081a6d51c27eb6af941f119b 100644 --- a/src/main/java/teetime/framework/exceptionHandling/LoggingStageListener.java +++ b/src/main/java/teetime/framework/exceptionHandling/LoggingExceptionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,11 @@ package teetime.framework.exceptionHandling; import teetime.framework.Stage; -public class LoggingStageListener extends StageExceptionHandler { +class LoggingExceptionListener extends AbstractExceptionListener { @Override public FurtherExecution onStageException(final Exception e, final Stage throwingStage) { - logger.warn("Exception arised from" + throwingStage.getId(), e); + logger.warn("Exception occurred in " + throwingStage.getId(), e); return FurtherExecution.CONTINUE; } diff --git a/src/main/java/teetime/framework/exceptionHandling/LoggingExceptionListenerFactory.java b/src/main/java/teetime/framework/exceptionHandling/LoggingExceptionListenerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..ec14ec20ea644502647132d7cdd76c9dab60ffe7 --- /dev/null +++ b/src/main/java/teetime/framework/exceptionHandling/LoggingExceptionListenerFactory.java @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework.exceptionHandling; + +public class LoggingExceptionListenerFactory implements IExceptionListenerFactory { + + @Override + public AbstractExceptionListener create() { + return new LoggingExceptionListener(); + } + +} diff --git a/src/main/java/teetime/framework/exceptionHandling/StageException.java b/src/main/java/teetime/framework/exceptionHandling/StageException.java index 78b97a12e051b8d469f4f5764ed3e65b5c8987ec..5bd0f0a78e8dcf1e318c503fffc685b56846fa5b 100644 --- a/src/main/java/teetime/framework/exceptionHandling/StageException.java +++ b/src/main/java/teetime/framework/exceptionHandling/StageException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ package teetime.framework.exceptionHandling; import teetime.framework.Stage; /** - * Represents an Exception, which is thrown by stages in case of they throw exceptions. - * To get the original exception, which was thrown, call {@link #getCause()}. {@link #getThrowingStage()} returns the stage, which has thrown the original exception. + * Represents an Exception, which is thrown by stages in case of theyimport teetime.framework.Stage; + original exception, which was thrown, call {@link #getCause()}. {@link #getThrowingStage()} returns the stage, which has thrown the original exception. * * @since 1.1 */ diff --git a/src/main/java/teetime/framework/exceptionHandling/TerminatingStageListener.java b/src/main/java/teetime/framework/exceptionHandling/TerminatingExceptionListener.java similarity index 77% rename from src/main/java/teetime/framework/exceptionHandling/TerminatingStageListener.java rename to src/main/java/teetime/framework/exceptionHandling/TerminatingExceptionListener.java index 73fd1517788934b8f6fac8e1f49838bbeb6962ab..7568264864061bfe4deb53c6a94e1d8eb61ef167 100644 --- a/src/main/java/teetime/framework/exceptionHandling/TerminatingStageListener.java +++ b/src/main/java/teetime/framework/exceptionHandling/TerminatingExceptionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,11 @@ package teetime.framework.exceptionHandling; import teetime.framework.Stage; -public class TerminatingStageListener extends StageExceptionHandler { +class TerminatingExceptionListener extends AbstractExceptionListener { @Override public FurtherExecution onStageException(final Exception e, final Stage throwingStage) { - logger.warn("Exception arised from" + throwingStage.getId(), e); + logger.warn("Exception occurred in " + throwingStage.getId(), e); return FurtherExecution.TERMINATE; } diff --git a/src/main/java/teetime/framework/exceptionHandling/TerminatingExceptionListenerFactory.java b/src/main/java/teetime/framework/exceptionHandling/TerminatingExceptionListenerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..f6f484fcbdfa78a91076ce030d078ba083882c29 --- /dev/null +++ b/src/main/java/teetime/framework/exceptionHandling/TerminatingExceptionListenerFactory.java @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework.exceptionHandling; + +public class TerminatingExceptionListenerFactory implements IExceptionListenerFactory { + + @Override + public AbstractExceptionListener create() { + return new TerminatingExceptionListener(); + } + +} diff --git a/src/main/java/teetime/framework/idle/IdleStrategy.java b/src/main/java/teetime/framework/idle/IdleStrategy.java index 10acced5a3bd152addb774b971c5e2229bee823c..454a128739564e097cfcfd4acd329cc6a81146f1 100644 --- a/src/main/java/teetime/framework/idle/IdleStrategy.java +++ b/src/main/java/teetime/framework/idle/IdleStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/idle/SleepStrategy.java b/src/main/java/teetime/framework/idle/SleepStrategy.java index 3cc9ce7f6b0753efc6ee419419c719af98c1e8d2..aa88c78b8fe59eaaf80fcf41898ec052f4cdb05b 100644 --- a/src/main/java/teetime/framework/idle/SleepStrategy.java +++ b/src/main/java/teetime/framework/idle/SleepStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/idle/YieldStrategy.java b/src/main/java/teetime/framework/idle/YieldStrategy.java index a23a99697f70737d1d29eb3c6118d2ce8e0e5b32..52bddcbd1511cef773286129d798c54809f66f0f 100644 --- a/src/main/java/teetime/framework/idle/YieldStrategy.java +++ b/src/main/java/teetime/framework/idle/YieldStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/package-info.java b/src/main/java/teetime/framework/package-info.java index 03f7c9cf697e0e6b9101d34b417f63d3f54d4060..c7a8dcfaf406172d85dfc5156b2d3fdb84952ac3 100644 --- a/src/main/java/teetime/framework/package-info.java +++ b/src/main/java/teetime/framework/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/CommittablePipe.java b/src/main/java/teetime/framework/pipe/CommittablePipe.java index bb76738765ccd9444effd4a6288996f0704c6ca8..098e4254c195bb06212f29fb94b95a7039d96ef6 100644 --- a/src/main/java/teetime/framework/pipe/CommittablePipe.java +++ b/src/main/java/teetime/framework/pipe/CommittablePipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/CommittablePipeFactory.java b/src/main/java/teetime/framework/pipe/CommittablePipeFactory.java index 85bb67e7593e1dcbdcc6d5c2179e33a9e46c4a3e..8589642d33ecca57300acbd4ca481d65d28a0973 100644 --- a/src/main/java/teetime/framework/pipe/CommittablePipeFactory.java +++ b/src/main/java/teetime/framework/pipe/CommittablePipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipe.java b/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipe.java index dd12be545ccc22b182415b82ba992439da24f3d5..3def592fa156eaed7920501c8e6cdee08bba89a6 100644 --- a/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipe.java +++ b/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipeFactory.java b/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipeFactory.java index 71a2484d3a91fdd943bee5dea87afa3cfe3062fc..f62aee8e5367cb721b5ddf563439501fa2918103 100644 --- a/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/ConcurrentBlockingIntraThreadPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java b/src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java index 6f2f1ee6b5b833aec521e718567bb8bc5ead5eca..0353a5b417c9b207a98ad51caedc9996ae202924 100644 --- a/src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java +++ b/src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/DummyPipe.java b/src/main/java/teetime/framework/pipe/DummyPipe.java index 6cdd1fe960adb09b213458e366915964ee8b859d..d02ab75b63e31e62d93cc7de3f058ca50c1b9012 100644 --- a/src/main/java/teetime/framework/pipe/DummyPipe.java +++ b/src/main/java/teetime/framework/pipe/DummyPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/IMonitorablePipe.java b/src/main/java/teetime/framework/pipe/IMonitorablePipe.java index 546e64ddca86531179bbda5c5ff964e21302e60d..a0c6a245900dfd51cbaa96ecee350aa584511750 100644 --- a/src/main/java/teetime/framework/pipe/IMonitorablePipe.java +++ b/src/main/java/teetime/framework/pipe/IMonitorablePipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/IPipe.java b/src/main/java/teetime/framework/pipe/IPipe.java index 5758e345fd01cea5607a0545bc197a0a9d51e6d0..f2fd15ecd4adf2a8f72f8d53e3f3fec9a9bf9a37 100644 --- a/src/main/java/teetime/framework/pipe/IPipe.java +++ b/src/main/java/teetime/framework/pipe/IPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/IPipeFactory.java b/src/main/java/teetime/framework/pipe/IPipeFactory.java index b9d7d8cc2214a1b89fe13cea38620e45bb5417ba..8319f0a9a6dc84f6c03199ea457d3642eaca077d 100644 --- a/src/main/java/teetime/framework/pipe/IPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/IPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java index 0703849785d3687db668a7a1ddc9b25f16cb882f..9d67274111d7f94ea1086a9cf696eee103cde86c 100644 --- a/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java +++ b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java index bd65862ff7b4118441aca4ce1b22d7d1cabbd828..d37082fb14d4f62f3f3f42896d246e49960a78c9 100644 --- a/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java b/src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java index b62481cefab7cc9957974040865c40beeef49d59..3930e58e8ee62052524798a022d75594856bc3eb 100644 --- a/src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java +++ b/src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/PipeFactoryLoader.java b/src/main/java/teetime/framework/pipe/PipeFactoryLoader.java index d9b2a140f28a4073feb2602f1cc37a00cf5003af..f610fb0802b16c9e3d44608c46fca32819c27b0d 100644 --- a/src/main/java/teetime/framework/pipe/PipeFactoryLoader.java +++ b/src/main/java/teetime/framework/pipe/PipeFactoryLoader.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java b/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java index 335d7349ecb0c94f8364fde17a43fd9fe234892f..1f5291c55ed47cdd48cd5ca62c82acdfb236820a 100644 --- a/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java +++ b/src/main/java/teetime/framework/pipe/PipeFactoryRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/RelayTestPipe.java b/src/main/java/teetime/framework/pipe/RelayTestPipe.java index 9afebf5f51f6fd485ec8f580dfa237b61c8e58d4..95e8ab49ce8678b84dda02edc498e3ab56948924 100644 --- a/src/main/java/teetime/framework/pipe/RelayTestPipe.java +++ b/src/main/java/teetime/framework/pipe/RelayTestPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/SingleElementPipe.java b/src/main/java/teetime/framework/pipe/SingleElementPipe.java index c24dd42f1cda55a15a64ea60af227207bdb72698..703ada6bd16b40830990f3fc0a593cacb8324587 100644 --- a/src/main/java/teetime/framework/pipe/SingleElementPipe.java +++ b/src/main/java/teetime/framework/pipe/SingleElementPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java b/src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java index e8a1a7af9bf188360dc3577c5583704384c7f5c6..ca83ae503c8c3e4625b457b7fed56b7159868ea1 100644 --- a/src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/SpScIntraThreadPipe.java b/src/main/java/teetime/framework/pipe/SpScIntraThreadPipe.java index 5f3c71c7caf9b624dafa0bd8bc9761ecc67abbb5..19f7e461bc34ae4f474fcbdf7d0090e557d04a66 100644 --- a/src/main/java/teetime/framework/pipe/SpScIntraThreadPipe.java +++ b/src/main/java/teetime/framework/pipe/SpScIntraThreadPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/SpScIntraThreadPipeFactory.java b/src/main/java/teetime/framework/pipe/SpScIntraThreadPipeFactory.java index 8725cf18c637d1f28ebc28c9e926eb5fae6f33a2..0fae0a6853632cc81e65a949063dc9a535f90431 100644 --- a/src/main/java/teetime/framework/pipe/SpScIntraThreadPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/SpScIntraThreadPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/SpScPipe.java b/src/main/java/teetime/framework/pipe/SpScPipe.java index cf714c4d6d959af3893196cf6bda7f55f987f148..bf28520d020e10bba4df712d9a895efa6e5726d2 100644 --- a/src/main/java/teetime/framework/pipe/SpScPipe.java +++ b/src/main/java/teetime/framework/pipe/SpScPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,11 @@ */ package teetime.framework.pipe; -import org.jctools.queues.ObservableSpScArrayQueue; - import teetime.framework.AbstractInterThreadPipe; import teetime.framework.InputPort; import teetime.framework.OutputPort; +import teetime.framework.StageState; +import teetime.util.concurrent.queue.ObservableSpScArrayQueue; public final class SpScPipe extends AbstractInterThreadPipe implements IMonitorablePipe { @@ -45,12 +45,15 @@ public final class SpScPipe extends AbstractInterThreadPipe implements IMonitora public boolean add(final Object element) { // BETTER introduce a QueueIsFullStrategy while (!this.queue.offer(element)) { - this.numWaits++; // Thread.yield(); + if (this.cachedTargetStage.getCurrentState() == StageState.TERMINATED) { + return false; + } + this.numWaits++; try { Thread.sleep(1); } catch (InterruptedException e) { - // TODO Auto-generated catch block + // FIXME Handle it correctly e.printStackTrace(); } } diff --git a/src/main/java/teetime/framework/pipe/SpScPipeFactory.java b/src/main/java/teetime/framework/pipe/SpScPipeFactory.java index d36f76b3e103a2d65840647ca74708b987a416ea..942c6ef50038f3b77fb6731352fbe9fb07a7bba0 100644 --- a/src/main/java/teetime/framework/pipe/SpScPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/SpScPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java b/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java index ded5c049f8ab3d3a28f1bfe07bb5d3aab5ad2658..6f0525d781a4a1e58589818d4b4d14fe2f880109 100644 --- a/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java +++ b/src/main/java/teetime/framework/pipe/UnboundedSpScPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/UnboundedSpScPipeFactory.java b/src/main/java/teetime/framework/pipe/UnboundedSpScPipeFactory.java index d342405f78ab1a80957eb495b16d48581d4d4060..164c566360c2414e172fdbbc3cc2e77e0610d986 100644 --- a/src/main/java/teetime/framework/pipe/UnboundedSpScPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/UnboundedSpScPipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java index 8d2c86b7b4155c41e58d241994f53e7ea99209f1..5331b3faa7416c4275cf47cd0957c7dcf767e2bb 100644 --- a/src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java +++ b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java index a3d1c80226fdddacab82a7af8f3c0dea306294c6..f1e314e789f18822707c0d091beb2e4cf5e9e22f 100644 --- a/src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java +++ b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/pipe/package-info.java b/src/main/java/teetime/framework/pipe/package-info.java index 8e63ee6135e8d387fed9a1055c0af4bf86e0728d..2c010a07f2fde563445479c12d597c21f89a941b 100644 --- a/src/main/java/teetime/framework/pipe/package-info.java +++ b/src/main/java/teetime/framework/pipe/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/signal/ISignal.java b/src/main/java/teetime/framework/signal/ISignal.java index 1e0df9fbac46234b85a1638f3245835ddde207b9..83326df1f05d75327995622876c070bd03afcd95 100644 --- a/src/main/java/teetime/framework/signal/ISignal.java +++ b/src/main/java/teetime/framework/signal/ISignal.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/signal/StartingSignal.java b/src/main/java/teetime/framework/signal/StartingSignal.java index 256d7cde879259ac0d1e672cb4aa102003466892..aea07608668cc1449a58c9abea0fac85ad65c520 100644 --- a/src/main/java/teetime/framework/signal/StartingSignal.java +++ b/src/main/java/teetime/framework/signal/StartingSignal.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/signal/TerminatingSignal.java b/src/main/java/teetime/framework/signal/TerminatingSignal.java index 4c71e301c41356eaabf1b0d055b3ebf1b3793586..6ff849490c99d57cbcf92eecc4506caabdc78af1 100644 --- a/src/main/java/teetime/framework/signal/TerminatingSignal.java +++ b/src/main/java/teetime/framework/signal/TerminatingSignal.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/signal/ValidatingSignal.java b/src/main/java/teetime/framework/signal/ValidatingSignal.java index 47137408b68809f79a501e991c38a36306a6a370..a15b37ee44f7da71e770b02a7c48322eccd83d4f 100644 --- a/src/main/java/teetime/framework/signal/ValidatingSignal.java +++ b/src/main/java/teetime/framework/signal/ValidatingSignal.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/signal/package-info.java b/src/main/java/teetime/framework/signal/package-info.java index d256f2e470f0bdf5c0d753edd5728e07c5f78ac8..2ebdac791ebbf8aa49910d541a5d7c1601300862 100644 --- a/src/main/java/teetime/framework/signal/package-info.java +++ b/src/main/java/teetime/framework/signal/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/test/InputHolder.java b/src/main/java/teetime/framework/test/InputHolder.java index b00e0e5a74ca8996919fb713d37048f47ddd3f08..41712ac8991a758ee9d53ae1a6aaef6d20b60253 100644 --- a/src/main/java/teetime/framework/test/InputHolder.java +++ b/src/main/java/teetime/framework/test/InputHolder.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/test/OutputHolder.java b/src/main/java/teetime/framework/test/OutputHolder.java index 64639aaf4ec154ecc433f4361093533596b484c5..9f9f5fb3de697dc3d7c88e5833b94b125ead83ed 100644 --- a/src/main/java/teetime/framework/test/OutputHolder.java +++ b/src/main/java/teetime/framework/test/OutputHolder.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/test/StageTester.java b/src/main/java/teetime/framework/test/StageTester.java index 6620640b46dbcfe8d3564ef41081b90be562c2e0..29b64eeb1bbd27c0da5bdb20d1554e999e363b0c 100644 --- a/src/main/java/teetime/framework/test/StageTester.java +++ b/src/main/java/teetime/framework/test/StageTester.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,19 +17,14 @@ package teetime.framework.test; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.List; import teetime.framework.Analysis; import teetime.framework.AnalysisConfiguration; import teetime.framework.Stage; import teetime.framework.StageState; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CollectorSink; import teetime.stage.IterableProducer; -import teetime.util.Pair; /** * This class can be used to test single stages in JUnit test cases. @@ -73,31 +68,28 @@ public final class StageTester { return this; } - public Collection<Pair<Thread, Throwable>> start() { + public void start() { final AnalysisConfiguration configuration = new Configuration(inputHolders, stage, outputHolders); final Analysis analysis = new Analysis(configuration); - return analysis.start(); + analysis.executeBlocking(); } private final class Configuration extends AnalysisConfiguration { public Configuration(final List<InputHolder<?>> inputHolders, final Stage stage, final List<OutputHolder<?>> outputHolders) { - final IPipeFactory interPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, false); for (InputHolder<?> inputHolder : inputHolders) { final IterableProducer<Object> producer = new IterableProducer<Object>(inputHolder.getInput()); - interPipeFactory.create(producer.getOutputPort(), inputHolder.getPort()); + connectBoundedInterThreads(producer.getOutputPort(), inputHolder.getPort()); addThreadableStage(producer); } addThreadableStage(stage); - final IPipeFactory intraPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); for (OutputHolder<?> outputHolder : outputHolders) { final CollectorSink<Object> sink = new CollectorSink<Object>(outputHolder.getOutputElements()); - intraPipeFactory.create(outputHolder.getPort(), sink.getInputPort()); + connectIntraThreads(outputHolder.getPort(), sink.getInputPort()); } } - } } diff --git a/src/main/java/teetime/framework/validation/AnalysisNotValidException.java b/src/main/java/teetime/framework/validation/AnalysisNotValidException.java index 0aa9f708dad8f1961f280da7bf4dde610734de9b..6041d3eddae4591477cf90ec57375a858ce4b34e 100644 --- a/src/main/java/teetime/framework/validation/AnalysisNotValidException.java +++ b/src/main/java/teetime/framework/validation/AnalysisNotValidException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/framework/validation/InvalidPortConnection.java b/src/main/java/teetime/framework/validation/InvalidPortConnection.java index 3a3f64ee2772a48adf30ef9e78b2ce82d8662165..edb75f14c62bf4ad53ba6740acf5da162074b7c1 100644 --- a/src/main/java/teetime/framework/validation/InvalidPortConnection.java +++ b/src/main/java/teetime/framework/validation/InvalidPortConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/ByteArray2String.java b/src/main/java/teetime/stage/ByteArray2String.java index aa9ca7264f134c38c003fdfd5924327c240d1285..5807095400ae19ba87b2e6a527a432d4e5c469ad 100644 --- a/src/main/java/teetime/stage/ByteArray2String.java +++ b/src/main/java/teetime/stage/ByteArray2String.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/Cache.java b/src/main/java/teetime/stage/Cache.java index 392fcd7968da493f3af24328c124fa96f3be2818..2fc6c7cdb0335dc863e60a4f59295de8feb39332 100644 --- a/src/main/java/teetime/stage/Cache.java +++ b/src/main/java/teetime/stage/Cache.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/CipherByteArray.java b/src/main/java/teetime/stage/CipherByteArray.java index 7f84ceeedcefd8ba20bb50caa480b029ab8dbff4..6fbacf19724580297decbbc14a7ae7cf98b53897 100644 --- a/src/main/java/teetime/stage/CipherByteArray.java +++ b/src/main/java/teetime/stage/CipherByteArray.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/Clock.java b/src/main/java/teetime/stage/Clock.java index 27d35ab4ad031eec283ce97a72469779ce908430..ecb536e5b488ba94164a2242bf0ccb9af29abb82 100644 --- a/src/main/java/teetime/stage/Clock.java +++ b/src/main/java/teetime/stage/Clock.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/CollectorSink.java b/src/main/java/teetime/stage/CollectorSink.java index e1aede24d7173fadc0eb19260c70c7a401efa9f3..828f235da94c9c017fd8fd47c9298db0443a43f0 100644 --- a/src/main/java/teetime/stage/CollectorSink.java +++ b/src/main/java/teetime/stage/CollectorSink.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/Counter.java b/src/main/java/teetime/stage/Counter.java index 0808f85c115b0d410f194c27396417c4428075a3..0dcfc2d54eaf34750fca64c430fa82dbc294de4c 100644 --- a/src/main/java/teetime/stage/Counter.java +++ b/src/main/java/teetime/stage/Counter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/CountingMapMerger.java b/src/main/java/teetime/stage/CountingMapMerger.java index 06d7b735c56812dbd39df1ba642768cd4d459505..ef273d53f9042822a35adedfd345fdbc64ae5aed 100644 --- a/src/main/java/teetime/stage/CountingMapMerger.java +++ b/src/main/java/teetime/stage/CountingMapMerger.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/ElementDelayMeasuringStage.java b/src/main/java/teetime/stage/ElementDelayMeasuringStage.java index 5777aebb0daf4ca50a466ddf0fc83c4235c68128..246d9244c325bce95523f31981d07df01cb9bb98 100644 --- a/src/main/java/teetime/stage/ElementDelayMeasuringStage.java +++ b/src/main/java/teetime/stage/ElementDelayMeasuringStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/ElementThroughputMeasuringStage.java b/src/main/java/teetime/stage/ElementThroughputMeasuringStage.java index a986ed8ef9e647ebd181afc621c11cef15f14482..848b2bd9292aa01160a2bfebdb6a9b761829f293 100644 --- a/src/main/java/teetime/stage/ElementThroughputMeasuringStage.java +++ b/src/main/java/teetime/stage/ElementThroughputMeasuringStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/EveryXthStage.java b/src/main/java/teetime/stage/EveryXthStage.java index c78c7e2700bf617cf2558b54c1db51602b2dae0d..dbded970a0c11b367b9376ec97e4c76c7d56f541 100644 --- a/src/main/java/teetime/stage/EveryXthStage.java +++ b/src/main/java/teetime/stage/EveryXthStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/FileExtensionSwitch.java b/src/main/java/teetime/stage/FileExtensionSwitch.java index 83783de696e91b17b4f740242109a0e627293068..7b39f3f9dffc41fdf0b2f50ffda295e27227d462 100644 --- a/src/main/java/teetime/stage/FileExtensionSwitch.java +++ b/src/main/java/teetime/stage/FileExtensionSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/InitialElementProducer.java b/src/main/java/teetime/stage/InitialElementProducer.java index 8766bf84162e3c9ae359c079ff7e862eef9dec03..01535b6704233f7de273bf6685a5d173a25f9f68 100644 --- a/src/main/java/teetime/stage/InitialElementProducer.java +++ b/src/main/java/teetime/stage/InitialElementProducer.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/InputPortSizePrinter.java b/src/main/java/teetime/stage/InputPortSizePrinter.java index ae629028eb6db67be83a299eb02564f8d3e55fa7..5c0f109edb77083847a34ea55ded46560fea18e8 100644 --- a/src/main/java/teetime/stage/InputPortSizePrinter.java +++ b/src/main/java/teetime/stage/InputPortSizePrinter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/InstanceCounter.java b/src/main/java/teetime/stage/InstanceCounter.java index c31e280dab80b7ebf11e1639d5c545e4a4ad3053..45fa3f6b9465ba7e2c3e95a1ef8e5190258de5c2 100644 --- a/src/main/java/teetime/stage/InstanceCounter.java +++ b/src/main/java/teetime/stage/InstanceCounter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/InstanceOfFilter.java b/src/main/java/teetime/stage/InstanceOfFilter.java index 5f09910372c23ad8f03b78af6f295a8cfe76cc65..1e72dd7e36a2fd93692774e729d5f9d099828dfd 100644 --- a/src/main/java/teetime/stage/InstanceOfFilter.java +++ b/src/main/java/teetime/stage/InstanceOfFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/IterableProducer.java b/src/main/java/teetime/stage/IterableProducer.java index 0f35b6edd109bfabe0b8bb34c43befb9cdeb0626..3a31136bb129843eaaba5965b71d3c2073102396 100644 --- a/src/main/java/teetime/stage/IterableProducer.java +++ b/src/main/java/teetime/stage/IterableProducer.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/MappingCounter.java b/src/main/java/teetime/stage/MappingCounter.java index ee9ab91800c2124003501b3a0a15e4e9e9deadc4..1fe1120324f5d41274fe1466bcf3e7a8b1a25b6c 100644 --- a/src/main/java/teetime/stage/MappingCounter.java +++ b/src/main/java/teetime/stage/MappingCounter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/MultipleInstanceOfFilter.java b/src/main/java/teetime/stage/MultipleInstanceOfFilter.java index b9d878040f444f17c850fa4b5f7424fe118cc185..46a363af2fd5f6c9162a83deab064cb958a50597 100644 --- a/src/main/java/teetime/stage/MultipleInstanceOfFilter.java +++ b/src/main/java/teetime/stage/MultipleInstanceOfFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/NoopFilter.java b/src/main/java/teetime/stage/NoopFilter.java index 8406d207d7bbb6c21261f3953666ffb1ced4d6e8..4f7dc7b37ef54ceb790cbeeff3d8c74451784725 100644 --- a/src/main/java/teetime/stage/NoopFilter.java +++ b/src/main/java/teetime/stage/NoopFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/ObjectProducer.java b/src/main/java/teetime/stage/ObjectProducer.java index eaf89dea7f218013555926877df3913342caf8b4..5e0c272ae74378ba108f9318bef9a358150ef843 100644 --- a/src/main/java/teetime/stage/ObjectProducer.java +++ b/src/main/java/teetime/stage/ObjectProducer.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/Relay.java b/src/main/java/teetime/stage/Relay.java index 7bf8e450ffafd3efd9dacc9799133ac3570c28ca..cead62d41d265d486a2c57ade8e66033d15c4388 100644 --- a/src/main/java/teetime/stage/Relay.java +++ b/src/main/java/teetime/stage/Relay.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/StartTimestampFilter.java b/src/main/java/teetime/stage/StartTimestampFilter.java index 56a2aef1d7635fa0db5281992801983249a7607c..ca951fda1cc3e5a4435ee0eff33aa8f84185dc8c 100644 --- a/src/main/java/teetime/stage/StartTimestampFilter.java +++ b/src/main/java/teetime/stage/StartTimestampFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/StopTimestampFilter.java b/src/main/java/teetime/stage/StopTimestampFilter.java index 1cbfd46472f7a4d68dd93ffb53ba444992a7c9c3..ccbb452ac06e6ce63987f015e2fe99e6fb7990ce 100644 --- a/src/main/java/teetime/stage/StopTimestampFilter.java +++ b/src/main/java/teetime/stage/StopTimestampFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/ZipByteArray.java b/src/main/java/teetime/stage/ZipByteArray.java index 5b9ac5ecb1519c0f6f8f04dea8c794dd83e613e5..b59e4e26c14e4d81e6bb627eec88b53ebb2b5eb9 100644 --- a/src/main/java/teetime/stage/ZipByteArray.java +++ b/src/main/java/teetime/stage/ZipByteArray.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/AbstractFilter.java b/src/main/java/teetime/stage/basic/AbstractFilter.java index a6f158c641883a56c67e707b43a0b620b2c40f4d..a22abb656ab673d7834f0cf9962ca61c2997078d 100644 --- a/src/main/java/teetime/stage/basic/AbstractFilter.java +++ b/src/main/java/teetime/stage/basic/AbstractFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/AbstractTransform.java b/src/main/java/teetime/stage/basic/AbstractTransform.java index a739238908491a685ac2c53c166e71c057c36784..3f8e84b281c174833e562cbf89e532f3ab5c7c36 100644 --- a/src/main/java/teetime/stage/basic/AbstractTransform.java +++ b/src/main/java/teetime/stage/basic/AbstractTransform.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/AbstractTrigger.java b/src/main/java/teetime/stage/basic/AbstractTrigger.java index 2d2d1c960cceea0111ecbc64f1fb7fae83d4a2cc..af2bf37880b84b34194e6c45c697af3beadc539e 100644 --- a/src/main/java/teetime/stage/basic/AbstractTrigger.java +++ b/src/main/java/teetime/stage/basic/AbstractTrigger.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/Delay.java b/src/main/java/teetime/stage/basic/Delay.java index 976bb7e69a19a0fa22a0849f8025632ec30f65fa..646c7f3a619700adde2caca45fc67ae45c38b664 100644 --- a/src/main/java/teetime/stage/basic/Delay.java +++ b/src/main/java/teetime/stage/basic/Delay.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/Sink.java b/src/main/java/teetime/stage/basic/Sink.java index 50a753f0c4b88f07c790e1745d2b8d1ae16a8e73..329a7f4199d7a648b43a9b1c9316f67ba5831419 100644 --- a/src/main/java/teetime/stage/basic/Sink.java +++ b/src/main/java/teetime/stage/basic/Sink.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/distributor/CloneStrategy.java b/src/main/java/teetime/stage/basic/distributor/CloneStrategy.java index ec3ef6428b9d76446c6948c6e9b9d39ab03b7122..7baf292a0da0e72a2f5b92977a1efc1974840ea6 100644 --- a/src/main/java/teetime/stage/basic/distributor/CloneStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/CloneStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java b/src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java index 5ca51a061f6606071a8109596055e3e7857a4ff9..537aa22dc2ecc266f94001e818a646eb8b350b20 100644 --- a/src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/distributor/Distributor.java b/src/main/java/teetime/stage/basic/distributor/Distributor.java index 057a709ef070c7b2750a5c5022cca4ea212c3985..ab19ba485881843df71f11530d24329101aa438b 100644 --- a/src/main/java/teetime/stage/basic/distributor/Distributor.java +++ b/src/main/java/teetime/stage/basic/distributor/Distributor.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java b/src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java index cc0946a5f6341c14b32178d016d6477515e40fbc..9a404d9dc34afbcb80e7c1401863fef129fe9bd2 100644 --- a/src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java b/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java index cdf05f46ecb16d8aaad4fd66116c88433f535e10..3f7f22e77df2b7439cb463fe18c4b88204e1d714 100644 --- a/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy2.java b/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy2.java index a9c843b459af16061d09efb3f2583387be831bed..e62f221b4fb3e9317d31239710045cb3f78af0c7 100644 --- a/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy2.java +++ b/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy2.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/merger/IMergerStrategy.java b/src/main/java/teetime/stage/basic/merger/IMergerStrategy.java index a17e1fef73b8d044001aac722498a928c46e46a3..10e22f807ba56df122815d215b8436e6be2ee93c 100644 --- a/src/main/java/teetime/stage/basic/merger/IMergerStrategy.java +++ b/src/main/java/teetime/stage/basic/merger/IMergerStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/merger/Merger.java b/src/main/java/teetime/stage/basic/merger/Merger.java index 52ef50be6df93ccbc3ca20fc4aedf7af65a4c3de..b1c745383fc4f73b44c6ac89866638ab8c055ac0 100644 --- a/src/main/java/teetime/stage/basic/merger/Merger.java +++ b/src/main/java/teetime/stage/basic/merger/Merger.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java b/src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java index 1f01a338124fbd3d789c60b28d765ab4a97a5ac7..38dc321ac03871b36c028dbf7c11e9f5be85ebe3 100644 --- a/src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java +++ b/src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/AbstractTcpReader.java b/src/main/java/teetime/stage/io/AbstractTcpReader.java index 3b2b502f54de041e60dad8d7b5d3e114694214e6..0227aecd4198112f1a088890f7859340556a44b3 100644 --- a/src/main/java/teetime/stage/io/AbstractTcpReader.java +++ b/src/main/java/teetime/stage/io/AbstractTcpReader.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/ByteArrayFileWriter.java b/src/main/java/teetime/stage/io/ByteArrayFileWriter.java index 66bb89cb8366c323abacc3e26e602deafd900a72..93375cd7d877cbbcbb516d7f6570776b83074efe 100644 --- a/src/main/java/teetime/stage/io/ByteArrayFileWriter.java +++ b/src/main/java/teetime/stage/io/ByteArrayFileWriter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/Directory2FilesFilter.java b/src/main/java/teetime/stage/io/Directory2FilesFilter.java index c306b236a5e57abf0f21aa20c23961e8e150bbe5..7a7844df97c988418857537e856d28d30da78025 100644 --- a/src/main/java/teetime/stage/io/Directory2FilesFilter.java +++ b/src/main/java/teetime/stage/io/Directory2FilesFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/EveryXthPrinter.java b/src/main/java/teetime/stage/io/EveryXthPrinter.java index ab1648bce3fa9413d2967026828afcaaf92d3824..bc218cf3d83ff6b4beb40cd19e19158e6757c94c 100644 --- a/src/main/java/teetime/stage/io/EveryXthPrinter.java +++ b/src/main/java/teetime/stage/io/EveryXthPrinter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package teetime.stage.io; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import teetime.framework.AbstractCompositeStage; @@ -57,9 +56,4 @@ public final class EveryXthPrinter<T> extends AbstractCompositeStage { return distributor; } - @Override - protected Collection<? extends Stage> getLastStages() { - return lastStages; - } - } diff --git a/src/main/java/teetime/stage/io/File2ByteArray.java b/src/main/java/teetime/stage/io/File2ByteArray.java index 155a45a31a7581d5fb77553afdf9461471976f6f..387a999746f6df0247be3e7ffd65775fedfa8cf1 100644 --- a/src/main/java/teetime/stage/io/File2ByteArray.java +++ b/src/main/java/teetime/stage/io/File2ByteArray.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/File2Lines.java b/src/main/java/teetime/stage/io/File2Lines.java index e4118b4769a6c4f268db199e99fbd1ff1cf38b73..bb97fd3657dec4c094c49f713d9ea02b429ca9ac 100644 --- a/src/main/java/teetime/stage/io/File2Lines.java +++ b/src/main/java/teetime/stage/io/File2Lines.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/File2SeqOfWords.java b/src/main/java/teetime/stage/io/File2SeqOfWords.java index d09589a66c86e07544ff00ce41733ad8f8144529..389fd1610365b34b346b0cc24fb7ad86fb9a2ff9 100644 --- a/src/main/java/teetime/stage/io/File2SeqOfWords.java +++ b/src/main/java/teetime/stage/io/File2SeqOfWords.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/File2TextLinesFilter.java b/src/main/java/teetime/stage/io/File2TextLinesFilter.java index e4861a77a29d1bd2d481aaeab2b50574447926cd..61045bcfad0f3a08191a24d1187decc7c4c5b203 100644 --- a/src/main/java/teetime/stage/io/File2TextLinesFilter.java +++ b/src/main/java/teetime/stage/io/File2TextLinesFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/io/Printer.java b/src/main/java/teetime/stage/io/Printer.java index bd36983163775b5ce6e3b027e58d262da59449fe..387486060441b581b47718fbe9154b148f8373ec 100644 --- a/src/main/java/teetime/stage/io/Printer.java +++ b/src/main/java/teetime/stage/io/Printer.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/package-info.java b/src/main/java/teetime/stage/package-info.java index 117057e7085bd2bdc301799ba28f78aecb9fe09f..eaa4a4d80331ea0f0e8c759dd570fa33983f54fc 100644 --- a/src/main/java/teetime/stage/package-info.java +++ b/src/main/java/teetime/stage/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/ToLowerCase.java b/src/main/java/teetime/stage/string/ToLowerCase.java index 78b4dc72c27beb30e46d531fe5168c13d0045694..16d06179622119f30419d120da3d092fc4147867 100644 --- a/src/main/java/teetime/stage/string/ToLowerCase.java +++ b/src/main/java/teetime/stage/string/ToLowerCase.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/Tokenizer.java b/src/main/java/teetime/stage/string/Tokenizer.java index 7e451b5b55e321e503f97355fc68622294870bcf..2d739a9567862f8e6637ddd05dc492076385c82f 100644 --- a/src/main/java/teetime/stage/string/Tokenizer.java +++ b/src/main/java/teetime/stage/string/Tokenizer.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/WordCounter.java b/src/main/java/teetime/stage/string/WordCounter.java index 57d196a5f440c09d83e33365a4a53831769a4adb..c2a8a409d0261e5c215897fc0cd8a3905f3a9c87 100644 --- a/src/main/java/teetime/stage/string/WordCounter.java +++ b/src/main/java/teetime/stage/string/WordCounter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package teetime.stage.string; import java.util.ArrayList; -import java.util.Collection; import teetime.framework.AbstractCompositeStage; import teetime.framework.InputPort; @@ -44,7 +43,6 @@ public final class WordCounter extends AbstractCompositeStage { // The connection of the different stages is realized within the construction of a instance of this class. public WordCounter() { this.lastStages.add(this.mapCounter); - final ToLowerCase toLowerCase = new ToLowerCase(); connectStages(this.tokenizer.getOutputPort(), toLowerCase.getInputPort()); @@ -57,11 +55,6 @@ public final class WordCounter extends AbstractCompositeStage { return this.tokenizer; } - @Override - protected Collection<? extends Stage> getLastStages() { - return this.lastStages; - } - public InputPort<String> getInputPort() { return this.tokenizer.getInputPort(); } diff --git a/src/main/java/teetime/stage/string/WordcharacterFilter.java b/src/main/java/teetime/stage/string/WordcharacterFilter.java index 876271e28e236f31239ee13479ea80dc9d9d037c..fdc416b50dd7c53b374ff0ad79fd225580b1273d 100644 --- a/src/main/java/teetime/stage/string/WordcharacterFilter.java +++ b/src/main/java/teetime/stage/string/WordcharacterFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/buffer/StringBufferFilter.java b/src/main/java/teetime/stage/string/buffer/StringBufferFilter.java index 1d32b31f9ea29102bdb4905e26014980b92295c6..cd187eff2679e60fff5a7312b88c35b585d24064 100644 --- a/src/main/java/teetime/stage/string/buffer/StringBufferFilter.java +++ b/src/main/java/teetime/stage/string/buffer/StringBufferFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/buffer/handler/AbstractDataTypeHandler.java b/src/main/java/teetime/stage/string/buffer/handler/AbstractDataTypeHandler.java index a4777b041376526b510db35aacd87bb29ec07ef9..6f4540cdfd1040c94e2971142543a29d4f4a2a59 100644 --- a/src/main/java/teetime/stage/string/buffer/handler/AbstractDataTypeHandler.java +++ b/src/main/java/teetime/stage/string/buffer/handler/AbstractDataTypeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/buffer/handler/StringHandler.java b/src/main/java/teetime/stage/string/buffer/handler/StringHandler.java index cee76c4b4c4c3b79077aacd1a7acfcd905d06b5a..bef40e5d09b74761661ad93725f3342d902c0edc 100644 --- a/src/main/java/teetime/stage/string/buffer/handler/StringHandler.java +++ b/src/main/java/teetime/stage/string/buffer/handler/StringHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/string/buffer/util/KiekerHashMap.java b/src/main/java/teetime/stage/string/buffer/util/KiekerHashMap.java index f92c7518baca52379e11233defad5f291e777ed1..1806abe5718cf67b3c6bf714ea30c741b82348db 100644 --- a/src/main/java/teetime/stage/string/buffer/util/KiekerHashMap.java +++ b/src/main/java/teetime/stage/string/buffer/util/KiekerHashMap.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/util/CountingMap.java b/src/main/java/teetime/stage/util/CountingMap.java index 52d8ab5a49a5487c17ebdc7cc928b14b21e348b2..de1714722dc016fd1737703714fb8fe1c05e6c66 100644 --- a/src/main/java/teetime/stage/util/CountingMap.java +++ b/src/main/java/teetime/stage/util/CountingMap.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/util/MappingException.java b/src/main/java/teetime/stage/util/MappingException.java index 456b61911d730afea1d6f85f194210956776b238..e7d8aeb53acbc49ad5329813d7c50ad72bc47fe1 100644 --- a/src/main/java/teetime/stage/util/MappingException.java +++ b/src/main/java/teetime/stage/util/MappingException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/stage/util/TextLine.java b/src/main/java/teetime/stage/util/TextLine.java index ecbfdb3295b8d36bb8998c006740d8b0e25cc1a1..3470c6a4a6f61c5c127220fae25dc7d640b7b875 100644 --- a/src/main/java/teetime/stage/util/TextLine.java +++ b/src/main/java/teetime/stage/util/TextLine.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/ArrayWrapper.java b/src/main/java/teetime/util/ArrayWrapper.java index 39c2192e4c1c2cb8badaccf7ad443fcf57d7eacc..5d32df57510aa5207fda0d030c2a911f34437d9e 100644 --- a/src/main/java/teetime/util/ArrayWrapper.java +++ b/src/main/java/teetime/util/ArrayWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/ConstructorClosure.java b/src/main/java/teetime/util/ConstructorClosure.java index d33836faf314cdab778ce69b714c3a6d42c5fee6..51c7667970cbc0f374f8128a4ef74ffb4987a439 100644 --- a/src/main/java/teetime/util/ConstructorClosure.java +++ b/src/main/java/teetime/util/ConstructorClosure.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/CyclicListIterator.java b/src/main/java/teetime/util/CyclicListIterator.java index d4e06d27453bc453c631419f61fd05c113e32a63..539659429b806b681c9675fec204f03317cc02f1 100644 --- a/src/main/java/teetime/util/CyclicListIterator.java +++ b/src/main/java/teetime/util/CyclicListIterator.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/HashMapWithDefault.java b/src/main/java/teetime/util/HashMapWithDefault.java index 7ebf6eb5c975ca044d283f47197bbb6aa961f19e..a54a1b81c896fed14360a546583cb8b26b4b7053 100644 --- a/src/main/java/teetime/util/HashMapWithDefault.java +++ b/src/main/java/teetime/util/HashMapWithDefault.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/ListUtil.java b/src/main/java/teetime/util/ListUtil.java index b6f70e3fac05974ab2ab0ab85e9a07c9b408f8d4..6ae6fea4836779395c49fca13c5a537a54a79c53 100644 --- a/src/main/java/teetime/util/ListUtil.java +++ b/src/main/java/teetime/util/ListUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/Pair.java b/src/main/java/teetime/util/Pair.java index 1cffdbf11c23a6c49b3fffad5fcca024543e8137..96ea6a61df295677dec8ce450d7cd16da5643dbb 100644 --- a/src/main/java/teetime/util/Pair.java +++ b/src/main/java/teetime/util/Pair.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/StacklessException.java b/src/main/java/teetime/util/StacklessException.java index c19c9f24b481f1e2a3e1f5a2c0caa19d069c030f..cafdca8517405ba7afcd97b036c5b9aab143752e 100644 --- a/src/main/java/teetime/util/StacklessException.java +++ b/src/main/java/teetime/util/StacklessException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/StopWatch.java b/src/main/java/teetime/util/StopWatch.java index 89c137d960c9a474f16dec23e747c095d5a20ff6..b3cfb99bc92b1022419d2cb07a01dde731813a49 100644 --- a/src/main/java/teetime/util/StopWatch.java +++ b/src/main/java/teetime/util/StopWatch.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,20 +15,26 @@ */ package teetime.util; +import java.util.concurrent.TimeUnit; + public final class StopWatch { private long startTimeInNs; private long endTimeInNs; - public final void start() { + public void start() { this.startTimeInNs = System.nanoTime(); } - public final void end() { + public void end() { this.endTimeInNs = System.nanoTime(); } - public final long getDurationInNs() { + public long getDurationInNs() { return this.endTimeInNs - this.startTimeInNs; } + + public long getDurationInMs() { + return TimeUnit.NANOSECONDS.toMillis(getDurationInNs()); + } } diff --git a/src/main/java/teetime/util/TimestampObject.java b/src/main/java/teetime/util/TimestampObject.java index a4e51521a8baa4751e5b188c97fbac8f37194453..65a1ef6929cce0c9d4eb7b07088d205b47187290 100644 --- a/src/main/java/teetime/util/TimestampObject.java +++ b/src/main/java/teetime/util/TimestampObject.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/classpath/CachedClassForNameResolver.java b/src/main/java/teetime/util/classpath/CachedClassForNameResolver.java index 6e1ec99f49d35703aff8aed6289da3c1fb7a55fc..65e3eb5d7bff9c853ca3d87eaebaf5b79180a44d 100644 --- a/src/main/java/teetime/util/classpath/CachedClassForNameResolver.java +++ b/src/main/java/teetime/util/classpath/CachedClassForNameResolver.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/classpath/ClassForNameResolver.java b/src/main/java/teetime/util/classpath/ClassForNameResolver.java index d084779936f2f75a954606f39a87dd44b0f253d4..3db67725c91be7cb732264b26b6ea6ffa2ecd673 100644 --- a/src/main/java/teetime/util/classpath/ClassForNameResolver.java +++ b/src/main/java/teetime/util/classpath/ClassForNameResolver.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/classpath/FileSearcher.java b/src/main/java/teetime/util/classpath/FileSearcher.java index 5daea960b01973914ce91dca001fab7c8950d75c..be1af8218d7da5f61cc4bcea543a42234e24e743 100644 --- a/src/main/java/teetime/util/classpath/FileSearcher.java +++ b/src/main/java/teetime/util/classpath/FileSearcher.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/hashmap/ConcurrentHashMapWithDefault.java b/src/main/java/teetime/util/concurrent/hashmap/ConcurrentHashMapWithDefault.java index 6c2a283fd165a1f6e57fa487b6fd6ebe17961aa8..98bdf02708294e10de5aca0c2da05af8b8a277bc 100644 --- a/src/main/java/teetime/util/concurrent/hashmap/ConcurrentHashMapWithDefault.java +++ b/src/main/java/teetime/util/concurrent/hashmap/ConcurrentHashMapWithDefault.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/hashmap/ValueFactory.java b/src/main/java/teetime/util/concurrent/hashmap/ValueFactory.java index 0d394c943bdc1de9f13c5f4d2d04b1f258e4d832..543cf5952e90479ca45720a56579a1524805f3be 100644 --- a/src/main/java/teetime/util/concurrent/hashmap/ValueFactory.java +++ b/src/main/java/teetime/util/concurrent/hashmap/ValueFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/queue/ObservableSpScArrayQueue.java b/src/main/java/teetime/util/concurrent/queue/ObservableSpScArrayQueue.java new file mode 100644 index 0000000000000000000000000000000000000000..a1d253a44d56b52f084abdc72eaecc874d171420 --- /dev/null +++ b/src/main/java/teetime/util/concurrent/queue/ObservableSpScArrayQueue.java @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.util.concurrent.queue; + +import org.jctools.queues.SpscArrayQueue; + +public final class ObservableSpScArrayQueue<E> extends SpscArrayQueue<E> { + + private transient long lastProducerIndex, lastConsumerIndex; + + public ObservableSpScArrayQueue(final int capacity) { + super(capacity); + } + + public long getNumPushes() { + return currentProducerIndex(); + } + + public long getNumPulls() { + return currentConsumerIndex(); + } + + public long getProducerFrequency() { + final long currentProducerIndex = getNumPushes(); + long diff = currentProducerIndex - lastProducerIndex; + lastProducerIndex = currentProducerIndex; + return diff; + } + + public long getConsumerFrequency() { + final long currentConsumerIndex = getNumPulls(); + long diff = currentConsumerIndex - lastConsumerIndex; + lastConsumerIndex = currentConsumerIndex; + return diff; + } + +} diff --git a/src/main/java/teetime/util/concurrent/queue/PCBlockingQueue.java b/src/main/java/teetime/util/concurrent/queue/PCBlockingQueue.java index 702ccc9e6ecb8fc146f5b222f587c1fa5c8a04a8..adf2678d6c951da06da6514e2aa906eb801be4d7 100644 --- a/src/main/java/teetime/util/concurrent/queue/PCBlockingQueue.java +++ b/src/main/java/teetime/util/concurrent/queue/PCBlockingQueue.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/queue/putstrategy/PutStrategy.java b/src/main/java/teetime/util/concurrent/queue/putstrategy/PutStrategy.java index 1c958b97c3aaf13f276a494faca756f3993a3221..90043b7bacad4d673b052466545eb8c5d0080d5f 100644 --- a/src/main/java/teetime/util/concurrent/queue/putstrategy/PutStrategy.java +++ b/src/main/java/teetime/util/concurrent/queue/putstrategy/PutStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/queue/putstrategy/YieldPutStrategy.java b/src/main/java/teetime/util/concurrent/queue/putstrategy/YieldPutStrategy.java index bef6afff82d6f570d208e1b7972d6964aa9e7ef1..4f3da0be4ba3594351d1122d060524958decd40c 100644 --- a/src/main/java/teetime/util/concurrent/queue/putstrategy/YieldPutStrategy.java +++ b/src/main/java/teetime/util/concurrent/queue/putstrategy/YieldPutStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/queue/takestrategy/SCParkTakeStrategy.java b/src/main/java/teetime/util/concurrent/queue/takestrategy/SCParkTakeStrategy.java index 7f42c039b7f21ab004dc217cb83313cffbd0ce48..6875d3815e8cb4d910288275b3bb8dcfa493e95e 100644 --- a/src/main/java/teetime/util/concurrent/queue/takestrategy/SCParkTakeStrategy.java +++ b/src/main/java/teetime/util/concurrent/queue/takestrategy/SCParkTakeStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/queue/takestrategy/TakeStrategy.java b/src/main/java/teetime/util/concurrent/queue/takestrategy/TakeStrategy.java index 4f2a2096e376de963ae92d85a7ddc72a0f81d747..d1fb3b9d7751b1c199e00c4c4a3f48afe735f5db 100644 --- a/src/main/java/teetime/util/concurrent/queue/takestrategy/TakeStrategy.java +++ b/src/main/java/teetime/util/concurrent/queue/takestrategy/TakeStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/queue/takestrategy/YieldTakeStrategy.java b/src/main/java/teetime/util/concurrent/queue/takestrategy/YieldTakeStrategy.java index 28b19de4b5f52a72cac654a9e65ae8f1e41f7496..9cd971f23417c7626c95e22b2cbfb064c1070897 100644 --- a/src/main/java/teetime/util/concurrent/queue/takestrategy/YieldTakeStrategy.java +++ b/src/main/java/teetime/util/concurrent/queue/takestrategy/YieldTakeStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/CircularArray.java b/src/main/java/teetime/util/concurrent/workstealing/CircularArray.java index 7b7e953275599791fe82c512ce6219da6a259ec7..7f1e10a5ff9897a3962a07dc71445cea732e0095 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/CircularArray.java +++ b/src/main/java/teetime/util/concurrent/workstealing/CircularArray.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/CircularIntArray.java b/src/main/java/teetime/util/concurrent/workstealing/CircularIntArray.java index 401ba5f8d1f70d3429398f5afe3b1c46d8406895..a4f4eda9def04fd06cc27b0f541bd9b51f13195b 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/CircularIntArray.java +++ b/src/main/java/teetime/util/concurrent/workstealing/CircularIntArray.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/CircularModIntArray.java b/src/main/java/teetime/util/concurrent/workstealing/CircularModIntArray.java index 810667d36c0da0a20e2ffc5a4e820f920964519a..a44239c5de9e33706a1ef8910e1a9efbb8332444 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/CircularModIntArray.java +++ b/src/main/java/teetime/util/concurrent/workstealing/CircularModIntArray.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/CircularWorkStealingDeque.java b/src/main/java/teetime/util/concurrent/workstealing/CircularWorkStealingDeque.java index 78b1ed4783ef6fdce6c28888bfdf40f11e7d1c54..cbab820ee86422b8087b13a458c0c2e4b3445806 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/CircularWorkStealingDeque.java +++ b/src/main/java/teetime/util/concurrent/workstealing/CircularWorkStealingDeque.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinel.java b/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinel.java index 91554954bb79f78c2fa8eda3359d70a31fd4b030..3eabf1f6824eaca45bee788a21a8a13bf1fa3913 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinel.java +++ b/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinel.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinel.java b/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinel.java index 88004d4525caf2a9b76dbfa57505cb5727c43f90..5cec666e37a44423a4e2aa1d580fd370f14e2977 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinel.java +++ b/src/main/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinel.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDeque.java b/src/main/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDeque.java index 934473cb6ad618de2bb21b0da3a60a204a358c00..4dc084bf7c8a2ec5a726941e70928f0cdf088ab1 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDeque.java +++ b/src/main/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDeque.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDeque.java b/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDeque.java index 35aeb0b0a44a39b8bea846c4a7d68e1ebbb89438..e5518e7c8db6bfc80dbbf5f3a803ba1e3747cadb 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDeque.java +++ b/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDeque.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDeque.java b/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDeque.java index 54b5fddba22705e51bd149a5027140d65a635229..f5d37b94e7f6d652dd098e282e5ad19e1499f32d 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDeque.java +++ b/src/main/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDeque.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/exception/DequeIsEmptyException.java b/src/main/java/teetime/util/concurrent/workstealing/exception/DequeIsEmptyException.java index a86e479fa83af8dab3b4d32c518b98dc9347e50d..08c58f6147e2045330d084682de060a2004e19e4 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/exception/DequeIsEmptyException.java +++ b/src/main/java/teetime/util/concurrent/workstealing/exception/DequeIsEmptyException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/exception/DequePopException.java b/src/main/java/teetime/util/concurrent/workstealing/exception/DequePopException.java index 6fd6ac2e1a7e6be0629b2d2270202d3340050561..e4ff1860c00ad1cc958298720074e981d8923f40 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/exception/DequePopException.java +++ b/src/main/java/teetime/util/concurrent/workstealing/exception/DequePopException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/concurrent/workstealing/exception/OperationAbortedException.java b/src/main/java/teetime/util/concurrent/workstealing/exception/OperationAbortedException.java index 6a640dea0a10df5ded3411d4b767ba33d8ca41d8..f814ac5fda2919eb4f32d9cb39f0edd77e790a57 100644 --- a/src/main/java/teetime/util/concurrent/workstealing/exception/OperationAbortedException.java +++ b/src/main/java/teetime/util/concurrent/workstealing/exception/OperationAbortedException.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/io/network/AbstractTcpReader.java b/src/main/java/teetime/util/io/network/AbstractTcpReader.java index 90d06b8fbada1dd70dcb2ba84284034c74ce1770..704eb58bbf252ab31211b16038ee16a5ec73b9d4 100644 --- a/src/main/java/teetime/util/io/network/AbstractTcpReader.java +++ b/src/main/java/teetime/util/io/network/AbstractTcpReader.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/ArrayPool.java b/src/main/java/teetime/util/list/ArrayPool.java index 8b66e68dba91c3b94515bb15c4b567291ff1ecac..40c23cc597634bd529e316d59251b4a6f5a817b1 100644 --- a/src/main/java/teetime/util/list/ArrayPool.java +++ b/src/main/java/teetime/util/list/ArrayPool.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/CircularList.java b/src/main/java/teetime/util/list/CircularList.java index d582e3e1a50c5d6e6ef43b1e92db2aa0c58a0628..bded6dd1cb5ca97434912f233bd107e18d67c452 100644 --- a/src/main/java/teetime/util/list/CircularList.java +++ b/src/main/java/teetime/util/list/CircularList.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/CommittableQueue.java b/src/main/java/teetime/util/list/CommittableQueue.java index 1701c4437949905429eec7260702cf83e90dc6ad..8c31a75f01d85a8064db020de788432d65c6249e 100644 --- a/src/main/java/teetime/util/list/CommittableQueue.java +++ b/src/main/java/teetime/util/list/CommittableQueue.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java b/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java index 32c8a6f562c08de532b20fa50ebd820aad1046cd..4349a2ae49a07462c6278948c91d8e70a7039cd2 100644 --- a/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java +++ b/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/ListContainer.java b/src/main/java/teetime/util/list/ListContainer.java index 623a8b035d1a5e92322a54e41a7408e597db7e3f..dd6d66a2710da5c5dd844df1b15cd36cef21eb93 100644 --- a/src/main/java/teetime/util/list/ListContainer.java +++ b/src/main/java/teetime/util/list/ListContainer.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/ListContainerPool.java b/src/main/java/teetime/util/list/ListContainerPool.java index a71a767fec3c05c90b820db38d0d7aacfb93e315..d470a3ef1314a30407e4250511ffb365c6288d2d 100644 --- a/src/main/java/teetime/util/list/ListContainerPool.java +++ b/src/main/java/teetime/util/list/ListContainerPool.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/ObjectPool.java b/src/main/java/teetime/util/list/ObjectPool.java index df9eca3292e22992d3cf5a77bcc71264e4ac482e..490dfcf770652b4edb7a3a5630e68ba0872b174f 100644 --- a/src/main/java/teetime/util/list/ObjectPool.java +++ b/src/main/java/teetime/util/list/ObjectPool.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/list/ObjectPooledLinkedList.java b/src/main/java/teetime/util/list/ObjectPooledLinkedList.java index 5b77af4a0627cd94207603bfeb97070eef5d0fd1..12b176387ecc30fa81bfb3ca3c8a7a9425fa3ad3 100644 --- a/src/main/java/teetime/util/list/ObjectPooledLinkedList.java +++ b/src/main/java/teetime/util/list/ObjectPooledLinkedList.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/package-info.java b/src/main/java/teetime/util/package-info.java index 5cdb057b4fc521e73b4cbdbcf447d579e236231f..380d9edb828490217134862173dedb7f09abce4b 100644 --- a/src/main/java/teetime/util/package-info.java +++ b/src/main/java/teetime/util/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/test/eval/BucketTimingsReader.java b/src/main/java/teetime/util/test/eval/BucketTimingsReader.java index df90e66e46c470d26d00a6767d4f755102da67f0..dcfcd8c72bd1e67cd84c6a94af6e3d471cc08927 100644 --- a/src/main/java/teetime/util/test/eval/BucketTimingsReader.java +++ b/src/main/java/teetime/util/test/eval/BucketTimingsReader.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/test/eval/MathUtil.java b/src/main/java/teetime/util/test/eval/MathUtil.java index 410a85eafab2f89394ec084a862250899a775b18..b42f18e237d63ce813d6d115f9e9ee0d42822dc4 100644 --- a/src/main/java/teetime/util/test/eval/MathUtil.java +++ b/src/main/java/teetime/util/test/eval/MathUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/test/eval/PerformanceResult.java b/src/main/java/teetime/util/test/eval/PerformanceResult.java index 5c8d05d8143ba7b13b71fee3279c9fa281e3a4f1..41e7443cef29e00dbaa1a4c0df39ef42680ee9ca 100644 --- a/src/main/java/teetime/util/test/eval/PerformanceResult.java +++ b/src/main/java/teetime/util/test/eval/PerformanceResult.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/teetime/util/test/eval/StatisticsUtil.java b/src/main/java/teetime/util/test/eval/StatisticsUtil.java index 48711f1a3b914198f77e6dfeeac70a7f57189c2d..c49c187d70189c996e1fab7f9701545c21c665ff 100644 --- a/src/main/java/teetime/util/test/eval/StatisticsUtil.java +++ b/src/main/java/teetime/util/test/eval/StatisticsUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java deleted file mode 100644 index 3bb9e58cd4e9796a242e8ce4c39a6b32d7e43959..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples; - -import static org.junit.Assert.assertEquals; - -import java.util.Map; -import java.util.Map.Entry; - -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -public class ChwHomeComparisonMethodcallWithPorts extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_HOME.toString(); - } - - @Override - public void check() { - Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; - for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { - System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); - } - - PerformanceResult test1 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test15 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test)"); - PerformanceResult test19a = performanceResults - .get("testWithManyObjectsAnd1Thread(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - PerformanceResult test19b = performanceResults - .get("testWithManyObjectsAnd2Threads(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - PerformanceResult test19c = performanceResults - .get("testWithManyObjectsAnd4Threads(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - - double value15 = (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5); - - System.out.println("value15: " + value15); - - // until 25.06.2014 (incl.) - // assertEquals(44, (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - // assertEquals(39, (double) test17.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - - // since 26.06.2014 (incl.) - // assertEquals(44, value15, 4.1); // +0 - // assertEquals(53, value17, 4.1); // +14 - - // // since 04.07.2014 (incl.) - // assertEquals(44, value15, 4.1); // +0 - // assertEquals(53, value17, 4.1); // +0 - - // since 11.08.2014 (incl.) - // assertEquals(44, value15, 4.1); // +0 - // assertEquals(53, value17, 4.1); // +0 - - // since 31.08.2014 (incl.) - // assertEquals(68, value15, 4.1); // +24 - // assertEquals(75, value17, 4.1); // +22 - - // since 04.11.2014 (incl.) - // assertEquals(40, value15, 4.1); // -28 - // assertEquals(78, value17, 4.1); // +3 - - // since 13.12.2014 (incl.) - // assertEquals(40, value15, 4.1); // -28 - // assertEquals(43, value17, 4.1); // -35 - - // since 28.12.2014 (incl.) - assertEquals(30, value15, 4.1); // -10 - - // check speedup - assertEquals(2, (double) test19a.overallDurationInNs / test19b.overallDurationInNs, 0.3); - assertEquals(2, (double) test19b.overallDurationInNs / test19c.overallDurationInNs, 0.3); - } - -} diff --git a/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java deleted file mode 100644 index ac34f1b42d9b141eda700c4219ceb06f8b81eea7..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples; - -import static org.junit.Assert.assertEquals; - -import java.util.Map; -import java.util.Map.Entry; - -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -public class ChwWorkComparisonMethodcallWithPorts extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_WORK.toString(); - } - - @Override - public void check() { - Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; - for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { - System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); - } - - PerformanceResult test1 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test15 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test)"); - PerformanceResult test19a = performanceResults - .get("testWithManyObjectsAnd1Thread(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - PerformanceResult test19b = performanceResults - .get("testWithManyObjectsAnd2Threads(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - PerformanceResult test19c = performanceResults - .get("testWithManyObjectsAnd4Threads(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - - double value15 = (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5); - - System.out.println("value15: " + value15); - - // until 25.06.2014 (incl.) - // assertEquals(44, (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - // assertEquals(39, (double) test17.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - - // since 26.06.2014 (incl.) - // assertEquals(44, value15, 4.1); // +0 - // assertEquals(53, value17, 4.1); // +14 - - // since 04.07.2014 (incl.) - // assertEquals(44, value15, 4.1); // +0 - // assertEquals(53, value17, 4.1); // +0 - - // since 27.08.2014 (incl.) - // assertEquals(44, value15, 4.1); // +0 - // assertEquals(53, value17, 4.1); // +0 - - // since 14.10.2014 (incl.) - assertEquals(36, value15, 4.1); // -8 - // assertEquals(46, value17, 4.1); // -7 - - // below results vary too much, possibly due to the OS' scheduler - // assertEquals(RESULT_TESTS_16, (double) test16a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_16, (double) test16b.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_16, (double) test16c.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // - // assertEquals(RESULT_TESTS_19, (double) test19a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_19, (double) test19b.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_19, (double) test19c.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - - // check speedup - assertEquals(2, (double) test19a.overallDurationInNs / test19b.overallDurationInNs, 0.3); - assertEquals(2.5, (double) test19a.overallDurationInNs / test19c.overallDurationInNs, 0.3); - } - -} diff --git a/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java deleted file mode 100644 index dd3973f6c024fcadb034c3fab560fb4297ffa0ac..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/ComparisonMethodcallWithPorts.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.examples.experiment09pipeimpls.MethodCallThoughputTimestampAnalysis9Test; -import teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; -import teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; -import teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; -import teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceCheckProfileRepository; - -@RunWith(Suite.class) -@SuiteClasses({ - MethodCallThoughputTimestampAnalysis1Test.class, - MethodCallThoughputTimestampAnalysis9Test.class, - MethodCallThoughputTimestampAnalysis11Test.class, - MethodCallThoughputTimestampAnalysis15Test.class, - MethodCallThoughputTimestampAnalysis16Test.class, - MethodCallThoughputTimestampAnalysis19Test.class, -}) -public class ComparisonMethodcallWithPorts { - - @BeforeClass - public static void beforeClass() { - // System.setProperty("logback.configurationFile", "src/test/resources/logback.groovy"); - PerformanceCheckProfileRepository.INSTANCE.register(ComparisonMethodcallWithPorts.class, new ChwWorkComparisonMethodcallWithPorts()); - PerformanceCheckProfileRepository.INSTANCE.register(ComparisonMethodcallWithPorts.class, new ChwHomeComparisonMethodcallWithPorts()); - PerformanceCheckProfileRepository.INSTANCE.register(ComparisonMethodcallWithPorts.class, new NieWorkComparisonMethodcallWithPorts()); - }; - - @AfterClass - public static void compareResults() { - AbstractProfiledPerformanceAssertion pcp = PerformanceCheckProfileRepository.INSTANCE.get(ComparisonMethodcallWithPorts.class); - pcp.check(); - } - -} diff --git a/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java b/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java deleted file mode 100644 index 7216f1916b52bd2faaab21a1ed306c8bc8d2c329..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples; - -import static org.junit.Assert.assertEquals; - -import java.util.Map; -import java.util.Map.Entry; - -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -public class NieWorkComparisonMethodcallWithPorts extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return "NieWork"; - } - - @Override - public void check() { - Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; - for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { - System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); - } - - PerformanceResult test1 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test9 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test)"); - PerformanceResult test10 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test)"); - PerformanceResult test11 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); - PerformanceResult test14 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test)"); - PerformanceResult test15 = performanceResults - .get("testWithManyObjects(teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test)"); - PerformanceResult test16a = performanceResults - .get("testWithManyObjectsAnd1Thread(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test16b = performanceResults - .get("testWithManyObjectsAnd2Threads(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test16c = performanceResults - .get("testWithManyObjectsAnd4Threads(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test19a = performanceResults - .get("testWithManyObjectsAnd1Thread(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - PerformanceResult test19b = performanceResults - .get("testWithManyObjectsAnd2Threads(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - PerformanceResult test19c = performanceResults - .get("testWithManyObjectsAnd4Threads(teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test)"); - - assertEquals(67, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - assertEquals(14, (double) test10.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); - assertEquals(39, (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - assertEquals(35, (double) test9.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - assertEquals(58, (double) test15.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - - // below results vary too much, possibly due to the OS' scheduler - // assertEquals(RESULT_TESTS_16, (double) test16a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_16, (double) test16b.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_16, (double) test16c.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // - // assertEquals(RESULT_TESTS_19, (double) test19a.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_19, (double) test19b.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // assertEquals(RESULT_TESTS_19, (double) test19c.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - - // assertEquals(56, (double) test17.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - - // check speedup - assertEquals(2, (double) test16a.overallDurationInNs / test16b.overallDurationInNs, 0.2); - assertEquals(3.7, (double) test16a.overallDurationInNs / test16c.overallDurationInNs, 0.2); - - assertEquals(2, (double) test19a.overallDurationInNs / test19b.overallDurationInNs, 0.2); - assertEquals(3.7, (double) test19a.overallDurationInNs / test19c.overallDurationInNs, 0.2); - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java deleted file mode 100644 index 9944e2c2be7ade243cd37821c95266fcf337456a..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -class ChwHomePerformanceCheck extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_HOME.toString(); - } - - @Override - public void check() { - PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - - assertEquals(292, test01.quantiles.get(0.5), 1); - } -} diff --git a/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java deleted file mode 100644 index d7762b8c40ea5beaa6d925b5935c009e6833d443..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -class ChwWorkPerformanceCheck extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_WORK.toString(); - } - - @Override - public void check() { - PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - - assertEquals(410, test01.quantiles.get(0.5), 1); - } -} diff --git a/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java b/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java deleted file mode 100644 index 89145e281ca50b5dd5b0cca2f8ea87840fd0a2a7..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; -import util.test.PerformanceCheckProfileRepository; -import util.test.PerformanceTest; -import util.test.AbstractProfiledPerformanceAssertion; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest { - - @BeforeClass - public static void beforeClass() { - PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis1Test.class, new ChwWorkPerformanceCheck()); - PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis1Test.class, new ChwHomePerformanceCheck()); - }; - - @AfterClass - public static void afterClass() { - AbstractProfiledPerformanceAssertion performanceCheckProfile = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis1Test.class); - performanceCheckProfile.check(); - }; - - // TODO check why the optimal, but inflexible impl is 500 times faster than our new framework - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis1 analysis = new MethodCallThroughputAnalysis1(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java b/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java deleted file mode 100644 index ba10a8e0fd5e28dd32b2b52028a48e2359291b9b..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01; - -import java.util.List; - -import teetime.examples.experiment01.legacystage.LegacyCollectorSink; -import teetime.examples.experiment01.legacystage.LegacyNoopFilter; -import teetime.examples.experiment01.legacystage.LegacyObjectProducer; -import teetime.examples.experiment01.legacystage.LegacyStartTimestampFilter; -import teetime.examples.experiment01.legacystage.LegacyStopTimestampFilter; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis1 { - - private long numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - public void init() { - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final LegacyNoopFilter<TimestampObject>[] noopFilters = new LegacyNoopFilter[this.numNoopFilters]; - // create stages - final LegacyObjectProducer<TimestampObject> objectProducer = new LegacyObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final LegacyStartTimestampFilter startTimestampFilter = new LegacyStartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new LegacyNoopFilter<TimestampObject>(); - } - final LegacyStopTimestampFilter stopTimestampFilter = new LegacyStopTimestampFilter(); - final LegacyCollectorSink<TimestampObject> collectorSink = new LegacyCollectorSink<TimestampObject>(this.timestampObjects); - - final Runnable runnable = new Runnable() { - @Override - public void run() { - while (true) { - TimestampObject object = objectProducer.execute(); - if (object == null) { - return; - } - - object = startTimestampFilter.execute(object); - for (final LegacyNoopFilter<TimestampObject> noopFilter : noopFilters) { - object = noopFilter.execute(object); - } - object = stopTimestampFilter.execute(object); - collectorSink.execute(object); - } - } - }; - return runnable; - } - - public void start() { - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyCollectorSink.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyCollectorSink.java deleted file mode 100644 index beac4130ac95e64b7368fd527cf01d1a950c57fe..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyCollectorSink.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01.legacystage; - -import java.util.List; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class LegacyCollectorSink<T> { - - // private final InputPort<T> inputPort = this.createInputPort(); - // - // public final InputPort<T> getInputPort() { - // return this.inputPort; - // } - - private final List<T> elements; - private final int threshold; - - public LegacyCollectorSink(final List<T> list, final int threshold) { - this.elements = list; - this.threshold = threshold; - } - - public LegacyCollectorSink(final List<T> list) { - this(list, 100000); - } - - public void onIsPipelineHead() { - System.out.println("size: " + this.elements.size()); - } - - public Object execute(final T element) { - this.elements.add(element); - - if ((this.elements.size() % this.threshold) == 0) { - System.out.println("size: " + this.elements.size()); - } - - return new Object(); - // if (this.elements.size() > 90000) { - // // System.out.println("size > 90000: " + this.elements.size()); - // } - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyObjectProducer.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyObjectProducer.java deleted file mode 100644 index e2eb0adf278fc0280f1d3f62234e62f9c5ee9d1d..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyObjectProducer.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01.legacystage; - -import teetime.util.ConstructorClosure; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class LegacyObjectProducer<T> { - - private long numInputObjects; - private ConstructorClosure<T> inputObjectCreator; - - /** - * @since 1.10 - */ - public LegacyObjectProducer(final long numInputObjects, final ConstructorClosure<T> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public long getNumInputObjects() { - return this.numInputObjects; - } - - public void setNumInputObjects(final long numInputObjects) { - this.numInputObjects = numInputObjects; - } - - public ConstructorClosure<T> getInputObjectCreator() { - return this.inputObjectCreator; - } - - public void setInputObjectCreator(final ConstructorClosure<T> inputObjectCreator) { - this.inputObjectCreator = inputObjectCreator; - } - - public T execute() { - if (this.numInputObjects == 0) { - return null; - } - - T newObject = this.inputObjectCreator.create(); - this.numInputObjects--; - - return newObject; - - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStartTimestampFilter.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStartTimestampFilter.java deleted file mode 100644 index 9a2721c4c4e4a9575eb9319548c4c39e436a02cd..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStartTimestampFilter.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01.legacystage; - -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class LegacyStartTimestampFilter { - - public TimestampObject execute(final TimestampObject element) { - element.setStartTimestamp(System.nanoTime()); - return element; - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStopTimestampFilter.java b/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStopTimestampFilter.java deleted file mode 100644 index e93e845e8dbe7876515e33ccbf6a1c364e3bbd20..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment01/legacystage/LegacyStopTimestampFilter.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment01.legacystage; - -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class LegacyStopTimestampFilter { - - public TimestampObject execute(final TimestampObject element) { - element.setStopTimestamp(System.nanoTime()); - return element; - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment09pipeimpls/AbstractPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment09pipeimpls/AbstractPerformanceCheck.java deleted file mode 100644 index 8f7eb29bba0b95ceb5d857e3f61bf9d1580d7f1c..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment09pipeimpls/AbstractPerformanceCheck.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment09pipeimpls; - -import teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.MeasurementRepository; -import util.test.PerformanceTest; - -abstract class AbstractPerformanceCheck extends AbstractProfiledPerformanceAssertion { - - protected PerformanceResult test01; - protected PerformanceResult test09CommittablePipes; - protected PerformanceResult test09SingleElementPipes; - protected PerformanceResult test09OrderedGrowableArrayPipes; - - @Override - public void check() { - String testMethodIdentifier = MeasurementRepository.buildTestMethodIdentifier(MethodCallThoughputTimestampAnalysis1Test.class, "testWithManyObjects"); - test01 = PerformanceTest.measurementRepository.performanceResults.get(testMethodIdentifier); - - testMethodIdentifier = MeasurementRepository.buildTestMethodIdentifier(MethodCallThoughputTimestampAnalysis9Test.class, "testCommittablePipes"); - test09CommittablePipes = PerformanceTest.measurementRepository.performanceResults.get(testMethodIdentifier); - - testMethodIdentifier = MeasurementRepository.buildTestMethodIdentifier(MethodCallThoughputTimestampAnalysis9Test.class, "testSingleElementPipes"); - test09SingleElementPipes = PerformanceTest.measurementRepository.performanceResults.get(testMethodIdentifier); - - testMethodIdentifier = MeasurementRepository.buildTestMethodIdentifier(MethodCallThoughputTimestampAnalysis9Test.class, "testOrderedGrowableArrayPipes"); - test09OrderedGrowableArrayPipes = PerformanceTest.measurementRepository.performanceResults.get(testMethodIdentifier); - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment09pipeimpls/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment09pipeimpls/ChwHomePerformanceCheck.java deleted file mode 100644 index 1622fb023e383d3bbf875663bf35d9b6ccec5290..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment09pipeimpls/ChwHomePerformanceCheck.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment09pipeimpls; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; - -class ChwHomePerformanceCheck extends AbstractPerformanceCheck { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_HOME.toString(); - } - - @Override - public void check() { - super.check(); - - checkCommittablePipes(); - checkSingleElementPipes(); - checkOrderedGrowableArrayPipes(); - } - - private void checkCommittablePipes() { - double medianSpeedup = (double) test09CommittablePipes.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (09 committable pipes): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(22, (double) test9.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); - // since 26.06.2014 (incl.) - // assertEquals(36, value9, 2.1); // +14 - // since 04.07.2014 (incl.) - // assertEquals(42, value9, 2.1); // +6 - // since 11.08.2014 (incl.) - // assertEquals(42, value9, 2.1); // +6 - // since 31.08.2014 (incl.) - // assertEquals(44, medianSpeedup, 2.1); // +2 - // since 04.11.2014 (incl.) - // assertEquals(71, medianSpeedup, 2.1); // +27 - // since 05.12.2014 (incl.) - assertEquals(43, medianSpeedup, 4.1); // -28 (41-56) - } - - private void checkSingleElementPipes() { - double medianSpeedup = (double) test09SingleElementPipes.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("meanSpeedup (09 single element pipes): " + medianSpeedup); - - // since 26.06.2014 (incl.) - // assertEquals(26, value10, 2.1); // +14 - // // since 04.07.2014 (incl.) - // assertEquals(26, value10, 2.1); // +0 - // since 11.08.2014 (incl.) - // assertEquals(47, value10, 2.1); // +21 - // since 31.08.2014 (incl.) - // assertEquals(51, medianSpeedup, 3.2); // +4 - // since 13.12.2014 (incl.) - // assertEquals(40, medianSpeedup, 3.2); // -11 - // since 28.12.2014 (incl.) - assertEquals(26, medianSpeedup, 3.2); // -14 - } - - private void checkOrderedGrowableArrayPipes() { - double medianSpeedup = (double) test09OrderedGrowableArrayPipes.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (09 ordered growable array pipes): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(60, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // since 26.06.2014 (incl.) - // assertEquals(76, medianSpeedup, 5.1); // +16 - // since 04.07.2014 (incl.) - // assertEquals(86, medianSpeedup, 5.1); // +16 - // since 11.08.2014 (incl.) - // assertEquals(103, medianSpeedup, 5.1); // +17 - // since 31.08.2014 (incl.) - // assertEquals(62, medianSpeedup, 2.1); // -41 - // since 04.11.2014 (incl.) - // assertEquals(84, medianSpeedup, 2.1); // +22 - // since 05.12.2014 (incl.) - // assertEquals(75, medianSpeedup, 2.1); // -9 - // since 13.12.2014 (incl.) - // assertEquals(44, medianSpeedup, 2.1); // -31 - // since 28.12.2014 (incl.) - assertEquals(46, medianSpeedup, 2.1); // +2 - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment09pipeimpls/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment09pipeimpls/ChwWorkPerformanceCheck.java deleted file mode 100644 index cc670a79a849d0b9b8ce76be1dcef445da89c1ca..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment09pipeimpls/ChwWorkPerformanceCheck.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment09pipeimpls; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; - -class ChwWorkPerformanceCheck extends AbstractPerformanceCheck { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_WORK.toString(); - } - - @Override - public void check() { - super.check(); - - checkCommittablePipes(); - checkSingleElementPipes(); - checkOrderedGrowableArrayPipes(); - } - - private void checkCommittablePipes() { - double medianSpeedup = (double) test09CommittablePipes.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (09): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(22, (double) test9.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); - // since 26.06.2014 (incl.) - // assertEquals(36, value9, 2.1); // +14 - // since 04.07.2014 (incl.) - // assertEquals(42, value9, 2.1); // +6 - // since 27.08.2014 (incl.) - // assertEquals(77, value9, 2.1); // +35 - // since 14.10.2014 (incl.) - // assertEquals(67, medianSpeedup, 3.1); // -10 - // since 19.12.2014 (incl.) - assertEquals(53, medianSpeedup, 3.1); // -14 - } - - private void checkSingleElementPipes() { - double medianSpeedup = (double) test09SingleElementPipes.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (09 single element pipes): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(14, (double) test10.quantiles.get(0.5) / test1.quantiles.get(0.5), 2.1); - // since 26.06.2014 (incl.) - // assertEquals(26, meanSpeedup, 2.1); // +14 - // since 04.07.2014 (incl.) - // assertEquals(26, meanSpeedup, 2.1); // +0 - // since 27.08.2014 (incl.) - // assertEquals(56, meanSpeedup, 2.1); // +30 - // since 14.10.2014 (incl.) - assertEquals(25, medianSpeedup, 3.1); // -31 - } - - private void checkOrderedGrowableArrayPipes() { - double medianSpeedup = (double) test09OrderedGrowableArrayPipes.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (09 ordered growable array pipes): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(60, (double) test14.quantiles.get(0.5) / test1.quantiles.get(0.5), 5.1); - // since 26.06.2014 (incl.) - // assertEquals(76, medianSpeedup, 5.1); // +16 - // since 04.07.2014 (incl.) - // assertEquals(86, medianSpeedup, 5.1); // +16 - // since 27.08.2014 (incl.) - // assertEquals(102, medianSpeedup, 5.1); // +16 - // since 14.10.2014 (incl.) - // assertEquals(81, medianSpeedup, 5.1); // -21 - // since 19.12.2014 (incl.) - assertEquals(56, medianSpeedup, 5.1); // -25 - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment09pipeimpls/MethodCallThoughputTimestampAnalysis9Test.java b/src/performancetest/java/teetime/examples/experiment09pipeimpls/MethodCallThoughputTimestampAnalysis9Test.java deleted file mode 100644 index f84e07d8a24edacbb37be314bc01a8148b2d06c2..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment09pipeimpls/MethodCallThoughputTimestampAnalysis9Test.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment09pipeimpls; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -import teetime.framework.pipe.CommittablePipeFactory; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.OrderedGrowableArrayPipeFactory; -import teetime.framework.pipe.SingleElementPipeFactory; -import teetime.framework.pipe.UnorderedGrowablePipeFactory; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis9Test extends PerformanceTest { - - @BeforeClass - public static void beforeClass() { - PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis9Test.class, new ChwWorkPerformanceCheck()); - PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis9Test.class, new ChwHomePerformanceCheck()); - } - - @AfterClass - public static void afterClass() { - AbstractProfiledPerformanceAssertion performanceCheckProfile = PERFORMANCE_CHECK_PROFILE_REPOSITORY.get(MethodCallThoughputTimestampAnalysis9Test.class); - performanceCheckProfile.check(); - } - - @Test - public void testCommittablePipes() throws Exception { - IPipeFactory pipeFactory = new CommittablePipeFactory(); - testWithManyObjects(pipeFactory); - } - - @Test - public void testSingleElementPipes() throws Exception { - IPipeFactory pipeFactory = new SingleElementPipeFactory(); - testWithManyObjects(pipeFactory); - } - - @Test - public void testOrderedGrowableArrayPipes() throws Exception { - IPipeFactory pipeFactory = new OrderedGrowableArrayPipeFactory(); - testWithManyObjects(pipeFactory); - } - - @Ignore - @Test - public void testUnorderedGrowablePipes() throws Exception { // TODO remove test 11 - IPipeFactory pipeFactory = new UnorderedGrowablePipeFactory(); - testWithManyObjects(pipeFactory); - } - - private void testWithManyObjects(final IPipeFactory pipeFactory) { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis9 analysis = new MethodCallThroughputAnalysis9(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(pipeFactory); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment09pipeimpls/MethodCallThroughputAnalysis9.java b/src/performancetest/java/teetime/examples/experiment09pipeimpls/MethodCallThroughputAnalysis9.java deleted file mode 100644 index 6bfaad61fd3e42735944034148b812d201a4bb52..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment09pipeimpls/MethodCallThroughputAnalysis9.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment09pipeimpls; - -import java.util.List; - -import teetime.framework.OldHeadPipeline; -import teetime.framework.RunnableProducerStage; -import teetime.framework.Stage; -import teetime.framework.exceptionHandling.IgnoringStageListener; -import teetime.framework.pipe.IPipeFactory; -import teetime.stage.CollectorSink; -import teetime.stage.NoopFilter; -import teetime.stage.ObjectProducer; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis9 { - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - public void init(final IPipeFactory pipeFactory) { - Stage pipeline = this.buildPipeline(pipeFactory); - this.runnable = new RunnableProducerStage(pipeline, new IgnoringStageListener()); - } - - /** - * @param pipeFactory - * @param numNoopFilters - * @return - * @since 1.10 - */ - private OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>> buildPipeline(final IPipeFactory pipeFactory) { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>> pipeline = new OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>>(); - pipeline.setFirstStage(objectProducer); - pipeline.setLastStage(collectorSink); - - pipeFactory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort()); - pipeFactory.create(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); - for (int i = 0; i < noopFilters.length - 1; i++) { - pipeFactory.create(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort()); - } - pipeFactory.create(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); - pipeFactory.create(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort()); - - return pipeline; - } - - public void start() { - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/performancetest/java/teetime/examples/experiment11/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment11/ChwHomePerformanceCheck.java deleted file mode 100644 index e0a0864496c87e8200b9209e7d66ca797f95087e..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment11/ChwHomePerformanceCheck.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment11; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -class ChwHomePerformanceCheck extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_HOME.toString(); - } - - @Override - public void check() { - PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test11 = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); - - double medianSpeedup = (double) test11.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (11): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(32, (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - // since 26.06.2014 (incl.) - // assertEquals(44, medianSpeedup, 4.1); // +12 - // since 04.07.2014 (incl.) - // assertEquals(41, medianSpeedup, 4.1); // -3 - // since 11.08.2014 (incl.) - // assertEquals(41, medianSpeedup, 4.1); // -3 - // since 31.08.2014 (incl.) - assertEquals(43, medianSpeedup, 4.1); // ?? - } -} diff --git a/src/performancetest/java/teetime/examples/experiment11/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment11/ChwWorkPerformanceCheck.java deleted file mode 100644 index ea4c302b269369302e0fe415e80db707ddf5602a..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment11/ChwWorkPerformanceCheck.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment11; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -class ChwWorkPerformanceCheck extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_WORK.toString(); - } - - @Override - public void check() { - PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjects(teetime.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test11 = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjects(teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test)"); - - double medianSpeedup = (double) test11.quantiles.get(0.5) / test01.quantiles.get(0.5); - - System.out.println("medianSpeedup (11): " + medianSpeedup); - - // until 25.06.2014 (incl.) - // assertEquals(32, (double) test11.quantiles.get(0.5) / test1.quantiles.get(0.5), 4.1); - // since 26.06.2014 (incl.) - // assertEquals(44, medianSpeedup, 4.1); // +12 - // since 04.07.2014 (incl.) - // assertEquals(41, medianSpeedup, 4.1); // -3 - // since 27.08.2014 (incl.) - // assertEquals(64, medianSpeedup, 4.1); // +15 - // since 14.10.2014 (incl.) - assertEquals(44, medianSpeedup, 4.1); // -20 - } -} diff --git a/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java b/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java deleted file mode 100644 index af549429ffe00110413de75850985542d9adbca0..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment11; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; -import util.test.PerformanceTest; -import util.test.AbstractProfiledPerformanceAssertion; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis11Test extends PerformanceTest { - - @BeforeClass - public static void beforeClass() { - PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis11Test.class, new ChwWorkPerformanceCheck()); - PERFORMANCE_CHECK_PROFILE_REPOSITORY.register(MethodCallThoughputTimestampAnalysis11Test.class, new ChwHomePerformanceCheck()); - }; - - @AfterClass - public static void afterClass() { - AbstractProfiledPerformanceAssertion performanceCheckProfile = PERFORMANCE_CHECK_PROFILE_REPOSITORY.get(MethodCallThoughputTimestampAnalysis11Test.class); - performanceCheckProfile.check(); - }; - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis11 analysis = new MethodCallThroughputAnalysis11(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java b/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java deleted file mode 100644 index 1c14ea89a79b581d8dcceb8ae78780f42ab6ee2d..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment11; - -import java.util.List; - -import teetime.framework.OldHeadPipeline; -import teetime.framework.RunnableProducerStage; -import teetime.framework.Stage; -import teetime.framework.exceptionHandling.IgnoringStageListener; -import teetime.framework.pipe.UnorderedGrowablePipe; -import teetime.stage.CollectorSink; -import teetime.stage.NoopFilter; -import teetime.stage.ObjectProducer; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis11 { - - private long numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - public void init() { - Stage pipeline = this.buildPipeline(this.numInputObjects, this.inputObjectCreator); - this.runnable = new RunnableProducerStage(pipeline, new IgnoringStageListener()); - } - - private OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>> buildPipeline(final long numInputObjects, - final ConstructorClosure<TimestampObject> inputObjectCreator) { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(numInputObjects, inputObjectCreator); - // Relay<TimestampObject> relay = new Relay<TimestampObject>(); - // NoopFilter<TimestampObject> relayFake = new NoopFilter<TimestampObject>(); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>> pipeline = new OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>>(); - pipeline.setFirstStage(objectProducer); - pipeline.setLastStage(collectorSink); - - UnorderedGrowablePipe.connect(objectProducer.getOutputPort(), startTimestampFilter.getInputPort()); - // UnorderedGrowablePipe.connect(objectProducer.getOutputPort(), relayFake.getInputPort()); - // UnorderedGrowablePipe.connect(relayFake.getOutputPort(), startTimestampFilter.getInputPort()); - - UnorderedGrowablePipe.connect(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); - for (int i = 0; i < noopFilters.length - 1; i++) { - UnorderedGrowablePipe.connect(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort()); - } - UnorderedGrowablePipe.connect(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); - UnorderedGrowablePipe.connect(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort()); - - return pipeline; - } - - public void start() { - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java b/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java deleted file mode 100644 index ace90f27081bcc3a8f032c291675842444875b67..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment15; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; -import util.test.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis15Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis15 analysis = new MethodCallThroughputAnalysis15(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java b/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java deleted file mode 100644 index e276da60d99e09e7cf2cb92b0cf9382f1afb0e94..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment15; - -import java.util.List; - -import teetime.framework.AnalysisConfiguration; -import teetime.framework.OldHeadPipeline; -import teetime.framework.RunnableProducerStage; -import teetime.framework.Stage; -import teetime.framework.exceptionHandling.IgnoringStageListener; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.OrderedGrowableArrayPipe; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; -import teetime.framework.pipe.SpScPipe; -import teetime.stage.Clock; -import teetime.stage.CollectorSink; -import teetime.stage.NoopFilter; -import teetime.stage.ObjectProducer; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.stage.basic.Delay; -import teetime.stage.basic.Sink; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis15 extends AnalysisConfiguration { - // FIXME this analysis sometimes runs infinitely - - private static final int SPSC_INITIAL_CAPACITY = 4; - - private final IPipeFactory intraThreadPipeFactory; - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - - private Runnable clockRunnable; - private Runnable runnable; - private Clock clock; - - public MethodCallThroughputAnalysis15() { - intraThreadPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); - } - - public void init() { - OldHeadPipeline<Clock, Sink<Long>> clockPipeline = this.buildClockPipeline(); - this.clockRunnable = new RunnableProducerStage(clockPipeline, new IgnoringStageListener()); - - Stage pipeline = this.buildPipeline(this.clock); - this.runnable = new RunnableProducerStage(pipeline, new IgnoringStageListener()); - } - - private OldHeadPipeline<Clock, Sink<Long>> buildClockPipeline() { - this.clock = new Clock(); - - this.clock.setInitialDelayInMs(100); - this.clock.setIntervalDelayInMs(100); - - final OldHeadPipeline<Clock, Sink<Long>> pipeline = new OldHeadPipeline<Clock, Sink<Long>>(); - pipeline.setFirstStage(this.clock); - pipeline.setLastStage(new Sink<Long>()); - - return pipeline; - } - - /** - * @param numNoopFilters - * @return - * @since 1.10 - */ - private OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>> buildPipeline(final Clock clock) { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - Delay<TimestampObject> delay = new Delay<TimestampObject>(); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>> pipeline = new OldHeadPipeline<ObjectProducer<TimestampObject>, CollectorSink<TimestampObject>>(); - pipeline.setFirstStage(objectProducer); - pipeline.setLastStage(collectorSink); - - SpScPipe.connect(clock.getOutputPort(), delay.getTimestampTriggerInputPort(), SPSC_INITIAL_CAPACITY); - - intraThreadPipeFactory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort()); - intraThreadPipeFactory.create(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); - for (int i = 0; i < noopFilters.length - 1; i++) { - intraThreadPipeFactory.create(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort()); - } - intraThreadPipeFactory.create(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); - OrderedGrowableArrayPipe.connect(stopTimestampFilter.getOutputPort(), delay.getInputPort()); - - intraThreadPipeFactory.create(delay.getOutputPort(), collectorSink.getInputPort()); - - return pipeline; - } - - public void start() { - Thread clockThread = new Thread(this.clockRunnable); - clockThread.start(); - this.runnable.run(); - clockThread.interrupt(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/performancetest/java/teetime/examples/experiment16/AnalysisConfiguration16.java b/src/performancetest/java/teetime/examples/experiment16/AnalysisConfiguration16.java deleted file mode 100644 index 171714f7fc9838e869936b4977b9bdf146c2af34..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment16/AnalysisConfiguration16.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment16; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import teetime.framework.AnalysisConfiguration; -import teetime.framework.OldHeadPipeline; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; -import teetime.framework.pipe.SpScPipe; -import teetime.stage.CollectorSink; -import teetime.stage.NoopFilter; -import teetime.stage.ObjectProducer; -import teetime.stage.Relay; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.stage.basic.distributor.Distributor; -import teetime.stage.io.EveryXthPrinter; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -class AnalysisConfiguration16 extends AnalysisConfiguration { - - private static final int SPSC_INITIAL_CAPACITY = 100100; - private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); - - private final IPipeFactory intraThreadPipeFactory; - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private final int numNoopFilters; - - private final List<List<TimestampObject>> timestampObjectsList = new LinkedList<List<TimestampObject>>(); - - private int numWorkerThreads; - - public AnalysisConfiguration16(final int numWorkerThreads, final int numNoopFilters) { - this.numWorkerThreads = numWorkerThreads; - this.numNoopFilters = numNoopFilters; - this.intraThreadPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); - } - - public void build() { - OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> producerPipeline = this.buildProducerPipeline(this.numInputObjects, - this.inputObjectCreator); - addThreadableStage(producerPipeline); - - this.numWorkerThreads = Math.min(NUM_WORKER_THREADS, this.numWorkerThreads); - - for (int i = 0; i < numWorkerThreads; i++) { - List<TimestampObject> resultList = new ArrayList<TimestampObject>(this.numInputObjects); - this.timestampObjectsList.add(resultList); - - OldHeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>> workerPipeline = this.buildPipeline(producerPipeline, resultList); - addThreadableStage(workerPipeline); - } - } - - private OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> buildProducerPipeline(final int numInputObjects, - final ConstructorClosure<TimestampObject> inputObjectCreator) { - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(numInputObjects, inputObjectCreator); - Distributor<TimestampObject> distributor = new Distributor<TimestampObject>(); - - final OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> pipeline = new OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>>(); - pipeline.setFirstStage(objectProducer); - pipeline.setLastStage(distributor); - - intraThreadPipeFactory.create(objectProducer.getOutputPort(), distributor.getInputPort()); - - return pipeline; - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private OldHeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>> buildPipeline( - final OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> previousStage, - final List<TimestampObject> timestampObjects) { - Relay<TimestampObject> relay = new Relay<TimestampObject>(); - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - EveryXthPrinter<TimestampObject> everyXthPrinter = new EveryXthPrinter<TimestampObject>(100000); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(timestampObjects); - - final OldHeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>> pipeline = new OldHeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>>(); - pipeline.setFirstStage(relay); - pipeline.setLastStage(collectorSink); - - SpScPipe.connect(previousStage.getLastStage().getNewOutputPort(), relay.getInputPort(), SPSC_INITIAL_CAPACITY); - - intraThreadPipeFactory.create(relay.getOutputPort(), startTimestampFilter.getInputPort()); - - intraThreadPipeFactory.create(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); - for (int i = 0; i < noopFilters.length - 1; i++) { - intraThreadPipeFactory.create(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort()); - } - intraThreadPipeFactory.create(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); - intraThreadPipeFactory.create(stopTimestampFilter.getOutputPort(), everyXthPrinter.getInputPort()); - intraThreadPipeFactory.create(everyXthPrinter.getNewOutputPort(), collectorSink.getInputPort()); - - return pipeline; - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public List<List<TimestampObject>> getTimestampObjectsList() { - return this.timestampObjectsList; - } - - public int getNumWorkerThreads() { - return this.numWorkerThreads; - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java deleted file mode 100644 index a21b243bf173ac5041d8724afe99a6f1bc8dede7..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment16; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -class ChwHomePerformanceCheck extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_HOME.toString(); - } - - @Override - public void check() { - PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd1Thread(" + MethodCallThoughputTimestampAnalysis16Test.class.getName() + ")"); - PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd2Threads(" + MethodCallThoughputTimestampAnalysis16Test.class.getName() + ")"); - PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd4Threads(" + MethodCallThoughputTimestampAnalysis16Test.class.getName() + ")"); - // check speedup - double speedupA2B = (double) test16a.overallDurationInNs / test16b.overallDurationInNs; - double speedupB2C = (double) test16b.overallDurationInNs / test16c.overallDurationInNs; - - System.out.println(ChwHomePerformanceCheck.class.getName() + ", speedupB: " + speedupA2B); - System.out.println(ChwHomePerformanceCheck.class.getName() + ", speedupC: " + speedupB2C); - - // assertEquals(2, speedupB, 0.3); - // since 31.08.2014 (incl.) - // assertEquals(3.6, speedupC, 0.3); - // since 04.11.2014 (incl.) - // assertEquals(5, speedupC, 0.4); - // since 07.12.2014 (incl.) - // assertEquals(2, speedupA2B, 0.4); - // assertEquals(5, speedupB2C, 0.4); - // since 28.12.2014 (incl.) - assertEquals(2, speedupA2B, 0.4); - assertEquals(2, speedupB2C, 0.4); - } -} diff --git a/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java b/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java deleted file mode 100644 index 210b13f6ffa9a3978da77dbf5d49124351c71272..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment16; - -import static org.junit.Assert.assertEquals; -import teetime.examples.HostName; -import teetime.util.test.eval.PerformanceResult; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceTest; - -class ChwWorkPerformanceCheck extends AbstractProfiledPerformanceAssertion { - - @Override - public String getCorrespondingPerformanceProfile() { - return HostName.CHW_WORK.toString(); - } - - @Override - public void check() { - PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd1Thread(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd2Threads(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults - .get("testWithManyObjectsAnd4Threads(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - // check speedup - double speedupB = (double) test16a.overallDurationInNs / test16b.overallDurationInNs; - double speedupC = (double) test16a.overallDurationInNs / test16c.overallDurationInNs; - - System.out.println("speedupB: " + speedupB); - System.out.println("speedupC: " + speedupC); - - assertEquals(2, speedupB, 0.3); - // assertEquals(2.5, speedupC, 0.3); - // since 19.12.2014 - assertEquals(2.0, speedupC, 0.3); - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java b/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java deleted file mode 100644 index 6e1d7dfa24304612e563cbddae3d867d5b10d942..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment16; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; - -import teetime.framework.Analysis; -import teetime.util.ConstructorClosure; -import teetime.util.ListUtil; -import teetime.util.TimestampObject; -import util.test.AbstractProfiledPerformanceAssertion; -import util.test.PerformanceCheckProfileRepository; -import util.test.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.0 - */ -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -// @RunWith(Parameterized.class) -public class MethodCallThoughputTimestampAnalysis16Test extends PerformanceTest { - - // private final int numThreads; - // - // @Parameters - // public static Iterable<Object[]> data() { - // return Arrays.asList(new Object[][] { - // { 1 }, { 2 }, { 4 } - // }); - // } - // - // public MethodCallThoughputTimestampAnalysis16Test(final int numThreads) { - // this.numThreads = numThreads; - // } - - @BeforeClass - public static void beforeClass() { - PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis16Test.class, new ChwWorkPerformanceCheck()); - PerformanceCheckProfileRepository.INSTANCE.register(MethodCallThoughputTimestampAnalysis16Test.class, new ChwHomePerformanceCheck()); - } - - @AfterClass - public static void afterClass() { - AbstractProfiledPerformanceAssertion pcp = PerformanceCheckProfileRepository.INSTANCE.get(MethodCallThoughputTimestampAnalysis16Test.class); - pcp.check(); - } - - @Test - public void testWithManyObjectsAnd1Thread() { - performAnalysis(1); - } - - @Test - public void testWithManyObjectsAnd2Threads() { - performAnalysis(2); - } - - @Test - public void testWithManyObjectsAnd4Threads() { - performAnalysis(4); - } - - private void performAnalysis(final int numThreads) { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final AnalysisConfiguration16 configuration = new AnalysisConfiguration16(numThreads, NUM_NOOP_FILTERS); - configuration.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - configuration.build(); - - final Analysis analysis = new Analysis(configuration); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - - this.timestampObjects = ListUtil.merge(configuration.getTimestampObjectsList()); - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java b/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java deleted file mode 100644 index 56f95ad6e2f77580ee381a85849045e3d410e0a1..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment19; - -import org.junit.FixMethodOrder; -import org.junit.Test; -import org.junit.runners.MethodSorters; - -import teetime.framework.Analysis; -import teetime.util.ConstructorClosure; -import teetime.util.ListUtil; -import teetime.util.TimestampObject; -import util.test.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class MethodCallThoughputTimestampAnalysis19Test extends PerformanceTest { - - // TODO use @Parameter for the number of threads - - @Test - public void testWithManyObjectsAnd1Thread() { - this.performAnalysis(1); - } - - @Test - public void testWithManyObjectsAnd2Threads() { - this.performAnalysis(2); - } - - @Test - public void testWithManyObjectsAnd4Threads() { - this.performAnalysis(4); - } - - // @AfterClass - // public static void afterClass() { - // PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults - // .get("testWithManyObjectsAnd1Thread(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - // PerformanceResult test16b = PerformanceTest.measurementRepository.performanceResults - // .get("testWithManyObjectsAnd2Threads(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - // PerformanceResult test16c = PerformanceTest.measurementRepository.performanceResults - // .get("testWithManyObjectsAnd4Threads(teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test)"); - // // check speedup - // assertEquals(2, (double) test16a.overallDurationInNs / test16b.overallDurationInNs, 0.2); - // assertEquals(2.5, (double) test16a.overallDurationInNs / test16c.overallDurationInNs, 0.2); - // } - - private void performAnalysis(final int numThreads) { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis19 configuration = new MethodCallThroughputAnalysis19(numThreads, NUM_NOOP_FILTERS); - configuration.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - configuration.build(); - - final Analysis analysis = new Analysis(configuration); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - - this.timestampObjects = ListUtil.merge(configuration.getTimestampObjectsList()); - } - -} diff --git a/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java b/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java deleted file mode 100644 index 0faa127c4a80a43b470c381194a1e3e9ca587416..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.experiment19; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import teetime.framework.AnalysisConfiguration; -import teetime.framework.OldHeadPipeline; -import teetime.framework.pipe.OrderedGrowableArrayPipe; -import teetime.framework.pipe.SpScPipe; -import teetime.stage.CollectorSink; -import teetime.stage.NoopFilter; -import teetime.stage.ObjectProducer; -import teetime.stage.Relay; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.stage.basic.distributor.Distributor; -import teetime.stage.io.EveryXthPrinter; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis19 extends AnalysisConfiguration { - - private static final int SPSC_INITIAL_CAPACITY = 100100; - private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); - - private final List<List<TimestampObject>> timestampObjectsList = new LinkedList<List<TimestampObject>>(); - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private final int numNoopFilters; - private int numWorkerThreads; - - public MethodCallThroughputAnalysis19(final int numWorkerThreads, final int numNoopFilters) { - this.numWorkerThreads = numWorkerThreads; - this.numNoopFilters = numNoopFilters; - } - - public void build() { - OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> producerPipeline = this.buildProducerPipeline(this.numInputObjects, - this.inputObjectCreator); - addThreadableStage(producerPipeline); - - this.numWorkerThreads = Math.min(NUM_WORKER_THREADS, this.numWorkerThreads); - - for (int i = 0; i < numWorkerThreads; i++) { - List<TimestampObject> resultList = new ArrayList<TimestampObject>(this.numInputObjects); - this.timestampObjectsList.add(resultList); - - OldHeadPipeline<?, ?> pipeline = this.buildPipeline(producerPipeline.getLastStage(), resultList); - addThreadableStage(pipeline); - } - } - - private OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> buildProducerPipeline(final int numInputObjects, - final ConstructorClosure<TimestampObject> inputObjectCreator) { - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(numInputObjects, inputObjectCreator); - Distributor<TimestampObject> distributor = new Distributor<TimestampObject>(); - - final OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>> pipeline = new OldHeadPipeline<ObjectProducer<TimestampObject>, Distributor<TimestampObject>>(); - pipeline.setFirstStage(objectProducer); - pipeline.setLastStage(distributor); - - OrderedGrowableArrayPipe.connect(objectProducer.getOutputPort(), distributor.getInputPort()); - - return pipeline; - } - - private OldHeadPipeline<?, ?> buildPipeline(final Distributor<TimestampObject> previousStage, final List<TimestampObject> timestampObjects) { - Relay<TimestampObject> relay = new Relay<TimestampObject>(); - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - EveryXthPrinter<TimestampObject> everyXthPrinter = new EveryXthPrinter<TimestampObject>(100000); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(timestampObjects); - - final OldHeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>> pipeline = new OldHeadPipeline<Relay<TimestampObject>, CollectorSink<TimestampObject>>(); - pipeline.setFirstStage(relay); - pipeline.setLastStage(collectorSink); - - SpScPipe.connect(previousStage.getNewOutputPort(), relay.getInputPort(), SPSC_INITIAL_CAPACITY); - - OrderedGrowableArrayPipe.connect(relay.getOutputPort(), startTimestampFilter.getInputPort()); - - OrderedGrowableArrayPipe.connect(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); - for (int i = 0; i < noopFilters.length - 1; i++) { - OrderedGrowableArrayPipe.connect(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort()); - } - OrderedGrowableArrayPipe.connect(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); - OrderedGrowableArrayPipe.connect(stopTimestampFilter.getOutputPort(), everyXthPrinter.getInputPort()); - OrderedGrowableArrayPipe.connect(everyXthPrinter.getNewOutputPort(), collectorSink.getInputPort()); - - return pipeline; - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public List<List<TimestampObject>> getTimestampObjectsList() { - return this.timestampObjectsList; - } - - public int getNumWorkerThreads() { - return this.numWorkerThreads; - } - -} diff --git a/src/performancetest/java/teetime/examples/loopStage/Countdown.java b/src/performancetest/java/teetime/examples/loopStage/Countdown.java deleted file mode 100644 index f1f71487c638706b96b5d5d2ab61598b02ddb7cd..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/loopStage/Countdown.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.loopStage; - -import teetime.framework.AbstractProducerStage; -import teetime.framework.InputPort; -import teetime.framework.OutputPort; - -public class Countdown extends AbstractProducerStage<Void> { - - private final InputPort<Integer> countdownInputPort = this.createInputPort(); - - private final OutputPort<Integer> newCountdownOutputPort = this.createOutputPort(); - - private final Integer initialCountdown; - - public Countdown(final Integer initialCountdown) { - this.initialCountdown = initialCountdown; - } - - @Override - public void onStarting() throws Exception { - super.onStarting(); - this.countdownInputPort.getPipe().add(this.initialCountdown); - } - - @Override - protected void execute() { - Integer countdown = this.countdownInputPort.receive(); - if (countdown == 0) { - outputPort.send(null); - this.terminate(); - } else { - newCountdownOutputPort.send(--countdown); - } - } - - public InputPort<Integer> getCountdownInputPort() { - return this.countdownInputPort; - } - - public OutputPort<Integer> getNewCountdownOutputPort() { - return this.newCountdownOutputPort; - } - -} diff --git a/src/performancetest/java/teetime/examples/loopStage/FiniteSignalPassingTest.java b/src/performancetest/java/teetime/examples/loopStage/FiniteSignalPassingTest.java deleted file mode 100644 index c0e5ff4f761b0322798642aecb91b1f5a05f4cbc..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/loopStage/FiniteSignalPassingTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.loopStage; - -import static org.junit.Assert.assertFalse; - -import org.junit.Test; - -import teetime.framework.Analysis; - -public class FiniteSignalPassingTest { - - @Test(timeout = 5000) - // may not run infinitely, so we set an arbitrary timeout that is high enough - public void testStartSignalDoesNotEndUpInInfiniteLoop() throws Exception { - boolean exceptionsOccured = false; - LoopStageAnalysisConfiguration configuration = new LoopStageAnalysisConfiguration(); - Analysis analysis = new Analysis(configuration); - analysis.init(); - try { - analysis.start(); - } catch (RuntimeException e) { - exceptionsOccured = true; - } - assertFalse(exceptionsOccured); - } -} diff --git a/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java b/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java deleted file mode 100644 index a03168d82fca95ed74c58ea217212de197a393c0..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.examples.loopStage; - -import teetime.framework.AnalysisConfiguration; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; - -public class LoopStageAnalysisConfiguration extends AnalysisConfiguration { - - public LoopStageAnalysisConfiguration() { - Countdown countdown = new Countdown(10); - - IPipeFactory factory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true); - factory.create(countdown.getNewCountdownOutputPort(), countdown.getCountdownInputPort()); - - // this.getFiniteProducerStages().add(countdown); - this.addThreadableStage(countdown); - } -} diff --git a/src/performancetest/java/teetime/framework/OldPipeline.java b/src/performancetest/java/teetime/framework/OldPipeline.java deleted file mode 100644 index 2d666cdc5af96f178346e322348b8a715c3e5c58..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/framework/OldPipeline.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.framework; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -@Deprecated -public class OldPipeline<FirstStage extends Stage, LastStage extends Stage> extends AbstractCompositeStage { - - protected FirstStage firstStage; - private final List<LastStage> lastStages = new ArrayList<LastStage>(); - - @Override - public FirstStage getFirstStage() { - return this.firstStage; - } - - public void setFirstStage(final FirstStage firstStage) { - this.firstStage = firstStage; - } - - public void setLastStage(final LastStage lastStage) { - this.lastStages.clear(); - this.lastStages.add(lastStage); - } - - public LastStage getLastStage() { - return lastStages.get(0); - } - - @Override - protected Collection<? extends Stage> getLastStages() { - return lastStages; - } - -} diff --git a/src/performancetest/java/teetime/runtime/typeCheck/ConnectionTypeTest.java b/src/performancetest/java/teetime/runtime/typeCheck/ConnectionTypeTest.java deleted file mode 100644 index 6996eefa25a97869b936466edbc015ec89647877..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/runtime/typeCheck/ConnectionTypeTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.runtime.typeCheck; - -import static org.junit.Assert.assertNull; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import org.junit.Test; - -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; -import teetime.stage.ObjectProducer; -import teetime.stage.StartTimestampFilter; -import teetime.stage.StopTimestampFilter; -import teetime.stage.basic.Sink; -import teetime.util.ConstructorClosure; -import teetime.util.TimestampObject; - -public class ConnectionTypeTest { - - private final PipeFactoryRegistry pipeFactory = PipeFactoryRegistry.INSTANCE; - - // tests for load-time validation - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Test - public void testDynamicPortConnection() throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, ClassNotFoundException { - ConstructorClosure<TimestampObject> constructorClosure = new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - - }; - - Constructor<ObjectProducer> constructor = ObjectProducer.class.getConstructor(long.class, ConstructorClosure.class); - - ObjectProducer objectProducer = constructor.newInstance(1, constructorClosure); - // PortTypeConfiguration.setPortTypes(objectProducer, Class.forName("teetime.variant.explicitScheduling.examples.throughput.TimestampObject")); - - StartTimestampFilter startTimestampFilter = StartTimestampFilter.class.newInstance(); - StopTimestampFilter stopTimestampFilter = StopTimestampFilter.class.newInstance(); - Sink sink = Sink.class.newInstance(); - - IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true); - factory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort()); - factory.create(startTimestampFilter.getOutputPort(), stopTimestampFilter.getInputPort()); - factory.create(stopTimestampFilter.getOutputPort(), sink.getInputPort()); - - // TypeVariable<Class<ObjectProducer>>[] objectProducerTypeParameters = ObjectProducer.class.getTypeParameters(); - // for (TypeVariable<Class<ObjectProducer>> typeVariable : objectProducerTypeParameters) { - // System.out.println(typeVariable.getBounds()); // ->[Ljava.lang.reflect.Type;@13a65d1f - // System.out.println(typeVariable.getBounds().length); // ->1 - // System.out.println(typeVariable.getBounds()[0]); // ->class java.lang.Object - // System.out.println(typeVariable.getName()); // ->T - // System.out.println(typeVariable.getClass()); // ->class sun.reflect.generics.reflectiveObjects.TypeVariableImpl - // System.out.println(typeVariable.getGenericDeclaration()); // ->class teetime.stage.ObjectProducer - // } - // - // Class<?> currentClass = objectProducer.getClass(); - // while (currentClass.getSuperclass() != null) { // we don't want to process Object.class - // Field[] fields = currentClass.getDeclaredFields(); - // for (Field field : fields) { - // // System.out.println("Field: " + field.getType()); - // if (OutputPort.class.equals(field.getType())) { - // System.out.println("Field.name: " + field.getName()); - // System.out.println("Field.type: " + field.getType()); - // // field.getType() - // } - // } - // - // currentClass = currentClass.getSuperclass(); - // } - - assertNull(objectProducer.getOutputPort().getType()); - // PortTypeConfiguration.setPortTypes(objectProducer, Class.forName(TimestampObject.class.getName())); - // assertEquals(TimestampObject.class, objectProducer.getOutputPort().getType()); - - assertNull(startTimestampFilter.getOutputPort().getType()); - // PortTypeConfiguration.setPortTypes(startTimestampFilter); - // assertEquals(TimestampObject.class, startTimestampFilter.getInputPort().getType()); - // assertEquals(TimestampObject.class, startTimestampFilter.getOutputPort().getType()); - } -} diff --git a/src/performancetest/java/teetime/util/CircularCollectionsTest.java b/src/performancetest/java/teetime/util/CircularCollectionsTest.java deleted file mode 100644 index b93c9c104125eaddae96998c38cbc1f8f411c496..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/CircularCollectionsTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util; - -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.lessThan; -import static org.junit.Assert.assertThat; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.FixMethodOrder; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.junit.runners.MethodSorters; - -import teetime.util.concurrent.workstealing.CircularArray; -import teetime.util.concurrent.workstealing.CircularIntArray; -import teetime.util.concurrent.workstealing.CircularModIntArray; -import teetime.util.list.CircularList; - -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class CircularCollectionsTest { - - private static final int NUM_OBJECTS_TO_CREATE_IN_POW2 = 2; - private static final int NUM_OBJECTS_TO_CREATE = (int) Math.pow(2, NUM_OBJECTS_TO_CREATE_IN_POW2); - private static final int NUM_ACCESSES = 100000000; - private static final int WARMUP_ITERATIONS = 3; - - private static final Map<String, Long> durations = new LinkedHashMap<String, Long>(); - - private StopWatch stopWatch; - protected Description description; - - @Before - public void setup() { - this.stopWatch = new StopWatch(); - } - - @Rule - public final TestRule watcher = new TestWatcher() { - @Override - protected void starting(final Description description) { - CircularCollectionsTest.this.description = description; - } - }; - - @After - public void tearDown() { - CircularCollectionsTest.durations.put(this.description.getDisplayName(), this.stopWatch.getDurationInNs()); - } - - @Test - public void testCircularIntArray() throws Exception { - CircularIntArray<Object> circularArray = new CircularIntArray<Object>(NUM_OBJECTS_TO_CREATE_IN_POW2); - for (int i = 0; i < NUM_OBJECTS_TO_CREATE; i++) { - circularArray.put(i, new Object()); - } - - int warmupIterations = WARMUP_ITERATIONS; - while (warmupIterations-- > 0) { - for (int i = 0; i < NUM_ACCESSES; i++) { - circularArray.getNext().toString(); - } - } - - this.stopWatch.start(); - for (int i = 0; i < NUM_ACCESSES; i++) { - circularArray.getNext().toString(); - } - this.stopWatch.end(); - } - - @Test - public void testCircularModIntArray() throws Exception { - CircularModIntArray<Object> circularArray = new CircularModIntArray<Object>(NUM_OBJECTS_TO_CREATE_IN_POW2); - for (int i = 0; i < NUM_OBJECTS_TO_CREATE; i++) { - circularArray.put(i, new Object()); - } - - int warmupIterations = WARMUP_ITERATIONS; - while (warmupIterations-- > 0) { - for (int i = 0; i < NUM_ACCESSES; i++) { - circularArray.getNext().toString(); - } - } - - this.stopWatch.start(); - for (int i = 0; i < NUM_ACCESSES; i++) { - circularArray.getNext().toString(); - } - this.stopWatch.end(); - } - - @Test - public void testCircularList() throws Exception { - CircularList<Object> circularList = new CircularList<Object>(); - for (int i = 0; i < NUM_OBJECTS_TO_CREATE; i++) { - circularList.add(new Object()); - } - - int warmupIterations = WARMUP_ITERATIONS; - while (warmupIterations-- > 0) { - for (int i = 0; i < NUM_ACCESSES; i++) { - circularList.getNext().toString(); - } - } - - this.stopWatch.start(); - for (int i = 0; i < NUM_ACCESSES; i++) { - circularList.getNext().toString(); - } - this.stopWatch.end(); - } - - @Test - public void testCircularLongArray() throws Exception { - CircularArray<Object> circularArray = new CircularArray<Object>(NUM_OBJECTS_TO_CREATE_IN_POW2); - for (int i = 0; i < NUM_OBJECTS_TO_CREATE; i++) { - circularArray.put(i, new Object()); - } - - int warmupIterations = WARMUP_ITERATIONS; - while (warmupIterations-- > 0) { - for (int i = 0; i < NUM_ACCESSES; i++) { - circularArray.getNext().toString(); - } - } - - this.stopWatch.start(); - for (int i = 0; i < NUM_ACCESSES; i++) { - circularArray.getNext().toString(); - } - this.stopWatch.end(); - } - - @AfterClass - public static void afterClass() { - Long circularIntArrayInNs = durations.get("testCircularIntArray(teetime.util.CircularCollectionsTest)"); - Long circularModIntArrayInNs = durations.get("testCircularModIntArray(teetime.util.CircularCollectionsTest)"); - Long circularListInNs = durations.get("testCircularList(teetime.util.CircularCollectionsTest)"); - Long circularLongArrayInNs = durations.get("testCircularLongArray(teetime.util.CircularCollectionsTest)"); - - for (Entry<String, Long> entry : durations.entrySet()) { - System.out.println(entry.getKey() + ": " + TimeUnit.NANOSECONDS.toMillis(entry.getValue()) + " ms"); - } - - assertThat(circularListInNs, is(lessThan(circularModIntArrayInNs))); - - // testCircularIntArray(teetime.util.CircularCollectionsTest): 13202 ms - // testCircularList(teetime.util.CircularCollectionsTest): 13957 ms - // testCircularLongArray(teetime.util.CircularCollectionsTest): 12620 ms - // testCircularModIntArray(teetime.util.CircularCollectionsTest): 14015 ms - } -} diff --git a/src/performancetest/java/teetime/util/StopWatchTest.java b/src/performancetest/java/teetime/util/StopWatchTest.java deleted file mode 100644 index 5bbb8a0789dd8d55a0f3adbf7acaa28ec032073f..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/StopWatchTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.junit.Test; - -import teetime.util.test.eval.StatisticsUtil; - -public class StopWatchTest { - - private static final int NUM_ITERATIONS = 1000000; - - @Test - public void testNanotime() throws Exception { - StopWatch iterationStopWatch = new StopWatch(); - - List<Long> durationsInNs = new ArrayList<Long>(NUM_ITERATIONS); - for (int i = 0; i < NUM_ITERATIONS; i++) { - iterationStopWatch.start(); - fib(BigInteger.valueOf(10l)); - iterationStopWatch.end(); - durationsInNs.add(iterationStopWatch.getDurationInNs()); - } - - Map<Double, Long> quintiles = StatisticsUtil.calculateQuintiles(durationsInNs); - StatisticsUtil.getQuantilesString(quintiles); - } - - public static BigInteger fib(final BigInteger n) { - if (n.compareTo(BigInteger.ONE) == -1 || n.compareTo(BigInteger.ONE) == 0) { - return n; - } else { - return fib(n.subtract(BigInteger.ONE)).add(fib(n.subtract(BigInteger.ONE).subtract(BigInteger.ONE))); - } - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/CircularWorkStealingDequeTest.java b/src/performancetest/java/teetime/util/concurrent/CircularWorkStealingDequeTest.java deleted file mode 100644 index cc9d6b429084ea853ccee10e52d94b3428fe333c..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/CircularWorkStealingDequeTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import teetime.util.StopWatch; -import teetime.util.concurrent.workstealing.CircularWorkStealingDeque; -import teetime.util.concurrent.workstealing.alternative.UntypedCircularWorkStealingDequeTest; - -public class CircularWorkStealingDequeTest { - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final CircularWorkStealingDeque<Object> deque = new CircularWorkStealingDeque<Object>(); - - final int numIterations = UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - deque.popBottom(); - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), - OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeTest.java b/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeTest.java deleted file mode 100644 index 4b29fbe7fefd7db730c64f3f7c7afec7f56ab113..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent.workstealing.alternative; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import teetime.util.StopWatch; -import teetime.util.concurrent.workstealing.CircularWorkStealingDeque; - -public class CircularWorkStealingDequeTest { - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final CircularWorkStealingDeque<Object> deque = new CircularWorkStealingDeque<Object>(); - - final int numIterations = UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - deque.popBottom(); - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinelTest.java b/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinelTest.java deleted file mode 100644 index 3aee0247a13ab96b50dce5e9fcfa6221d3193d23..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithSentinelTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent.workstealing.alternative; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import teetime.util.StopWatch; - -public class CircularWorkStealingDequeWithSentinelTest { - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final CircularWorkStealingDequeWithSentinel<Object> deque = new CircularWorkStealingDequeWithSentinel<Object>(); - - final int numIterations = UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - deque.popBottom(); - // if (returnValue.getState() != State.EMPTY) { - // returnValue.getValue(); - // } - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinelTest.java b/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinelTest.java deleted file mode 100644 index c542c078e54d034ffffe34b20bfa784d4dd6ea63..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/CircularWorkStealingDequeWithThreadLocalSentinelTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent.workstealing.alternative; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import teetime.util.StopWatch; - -public class CircularWorkStealingDequeWithThreadLocalSentinelTest { - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final CircularWorkStealingDequeWithThreadLocalSentinel<Object> deque = new CircularWorkStealingDequeWithThreadLocalSentinel<Object>(); - - final int numIterations = UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - deque.popBottom(); - // if (returnValue.getState() != State.EMPTY) { - // returnValue.getValue(); - // } - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDequeTest.java b/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDequeTest.java deleted file mode 100644 index 288ac1939ef8a90a64a6c99be178a9164fc72ba1..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/ExceptionalCircularWorkStealingDequeTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent.workstealing.alternative; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -import teetime.util.StopWatch; -import teetime.util.concurrent.workstealing.exception.DequeIsEmptyException; - -@Ignore -public class ExceptionalCircularWorkStealingDequeTest { - - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final ExceptionalCircularWorkStealingDeque<String> deque = new ExceptionalCircularWorkStealingDeque<String>(); - - final int numIterations = UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - try { - deque.popBottom(); - } catch (final DequeIsEmptyException e) { - // do not handle; we just want to compare the performance of throwing a preallocated exception vs. returning special values - throw new IllegalStateException(e); - } - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDequeTest.java b/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDequeTest.java deleted file mode 100644 index d278b08992c46f641a05b1b5e2003ebae1ec5390..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/UntypedCircularWorkStealingDequeTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent.workstealing.alternative; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import teetime.util.StopWatch; - -public class UntypedCircularWorkStealingDequeTest { - - public static final int NUM_ITERATIONS = 100000000; - public static final long EXPECTED_DURATION_IN_NS = 1100*1000*1000; - - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final UntypedCircularWorkStealingDeque deque = new UntypedCircularWorkStealingDeque(); - - final int numIterations = NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - deque.popBottom(); - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - } -} diff --git a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDequeTest.java b/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDequeTest.java deleted file mode 100644 index a234818cb6701170fa58cf7dc66325ec706cad2e..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/concurrent/workstealing/alternative/UntypedExceptionalCircularWorkStealingDequeTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.concurrent.workstealing.alternative; - -import org.hamcrest.number.OrderingComparison; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -import teetime.util.StopWatch; -import teetime.util.concurrent.workstealing.exception.DequeIsEmptyException; - -public class UntypedExceptionalCircularWorkStealingDequeTest { - - private StopWatch stopWatch; - - @Before - public void before() { - this.stopWatch = new StopWatch(); - } - - @Test - public void measureManyEmptyPulls() { - final UntypedExceptionalCircularWorkStealingDeque deque = new UntypedExceptionalCircularWorkStealingDeque(); - System.out.println(UntypedExceptionalCircularWorkStealingDeque.DEQUE_IS_EMPTY_EXCEPTION); - System.out.println(UntypedExceptionalCircularWorkStealingDeque.OPERATION_ABORTED_EXCEPTION); - - int counter = 0; - final int numIterations = UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS; - this.stopWatch.start(); - for (int i = 0; i < numIterations; i++) { - try { - deque.popBottom(); - } catch (final DequeIsEmptyException e) { - // do not handle; we just want to compare the performance of throwing a preallocated exception vs. returning special values - counter++; - } - } - this.stopWatch.end(); - - Assert.assertThat(this.stopWatch.getDurationInNs(), OrderingComparison.lessThan(UntypedCircularWorkStealingDequeTest.EXPECTED_DURATION_IN_NS)); - Assert.assertThat(counter, OrderingComparison.comparesEqualTo(UntypedCircularWorkStealingDequeTest.NUM_ITERATIONS)); - } -} diff --git a/src/performancetest/java/teetime/util/list/CommittableResizableArrayQueueTest.java b/src/performancetest/java/teetime/util/list/CommittableResizableArrayQueueTest.java deleted file mode 100644 index d7c2fcd7f8d54fe87cc409686f7421d7afe9748a..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/util/list/CommittableResizableArrayQueueTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.util.list; - -import org.junit.Assert; -import org.junit.Test; - -public class CommittableResizableArrayQueueTest { - - @Test - public void testCommit() throws Exception { - CommittableResizableArrayQueue<Object> reservableArrayList = new CommittableResizableArrayQueue<Object>(null, 10); - Object element = new Object(); - reservableArrayList.addToTailUncommitted(element); - - Assert.assertTrue(reservableArrayList.isEmpty()); - - reservableArrayList.commit(); - - Assert.assertFalse(reservableArrayList.isEmpty()); - Assert.assertEquals(element, reservableArrayList.getTail()); - } - - @Test - public void testRollback() throws Exception { - CommittableResizableArrayQueue<Object> reservableArrayList = new CommittableResizableArrayQueue<Object>(null, 10); - Object element = new Object(); - reservableArrayList.addToTailUncommitted(element); - - Assert.assertTrue(reservableArrayList.isEmpty()); - - reservableArrayList.rollback(); - - Assert.assertTrue(reservableArrayList.isEmpty()); - // Assert.assertEquals(element, reservableArrayList.getLast()); - } - - @Test - public void testRemove() throws Exception { - CommittableResizableArrayQueue<Object> reservableArrayList = new CommittableResizableArrayQueue<Object>(null, 10); - Object element = new Object(); - reservableArrayList.addToTailUncommitted(element); - reservableArrayList.commit(); - - Assert.assertEquals(element, reservableArrayList.removeFromHeadUncommitted()); - Assert.assertFalse(reservableArrayList.isEmpty()); - - reservableArrayList.commit(); - - Assert.assertTrue(reservableArrayList.isEmpty()); - } -} diff --git a/src/site/markdown/index.markdown b/src/site/markdown/index.markdown index eaae70ae49d27b34e8c0b94744c48720f8118784..8840c20d81608b4a855650e76ac8c6b983e7d3ff 100644 --- a/src/site/markdown/index.markdown +++ b/src/site/markdown/index.markdown @@ -28,7 +28,7 @@ In particular, it features... - many primitive and composite ready-to-use stages -- a type-safety way to develop and connect stages +- a type-safe way to develop and connect stages - no(!) single-threaded overhead diff --git a/src/site/markdown/wiki b/src/site/markdown/wiki index 0e4474577e1f49bc96e734c286b2d9e0363895e8..162510ff4d2f04011498ba6920aae0c78347c6c8 160000 --- a/src/site/markdown/wiki +++ b/src/site/markdown/wiki @@ -1 +1 @@ -Subproject commit 0e4474577e1f49bc96e734c286b2d9e0363895e8 +Subproject commit 162510ff4d2f04011498ba6920aae0c78347c6c8 diff --git a/src/site/resources/LICENSE.txt b/src/site/resources/LICENSE.txt index 51aa7afaf65b774672b388bca032f7785c2872e7..a77fc9e449e82262846a685211eed9981f876743 100644 --- a/src/site/resources/LICENSE.txt +++ b/src/site/resources/LICENSE.txt @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2015 TeeTime (http://teetime.sourceforge.net) + Copyright 2015 Christian Wulf, Nelson Tavares de Sousa Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/test/java/qa/cs/PluralForCollectionVariable.java b/src/test/java/qa/cs/PluralForCollectionVariable.java new file mode 100644 index 0000000000000000000000000000000000000000..85845dd0b594312098a19355fe2b99e82f457456 --- /dev/null +++ b/src/test/java/qa/cs/PluralForCollectionVariable.java @@ -0,0 +1,58 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 qa.cs; + +import java.util.HashSet; +import java.util.Set; + +import com.puppycrawl.tools.checkstyle.api.Check; +import com.puppycrawl.tools.checkstyle.api.DetailAST; +import com.puppycrawl.tools.checkstyle.api.TokenTypes; + +public class PluralForCollectionVariable extends Check { + + private final Set<String> collectionNames = new HashSet<String>(); + + public PluralForCollectionVariable() { + collectionNames.add("Collection"); + collectionNames.add("Set"); + collectionNames.add("List"); + } + + @Override + public int[] getDefaultTokens() { + return new int[] { TokenTypes.VARIABLE_DEF }; + } + + @Override + public void visitToken(final DetailAST ast) { + DetailAST typeAst = ast.findFirstToken(TokenTypes.TYPE); + DetailAST identifierAst = ast.findFirstToken(TokenTypes.IDENT); + + DetailAST actualTypeAst = typeAst.getFirstChild(); + DetailAST typeArgumentsAst = actualTypeAst.getNextSibling(); + String actualTypeName = actualTypeAst.getText(); + if (collectionNames.contains(actualTypeName)) { + String identifierName = identifierAst.getText(); + if (!identifierName.endsWith("s")) { + String message = "The variable '" + identifierName + "' should be named in plural since it represents a " + actualTypeName + " of " + + typeArgumentsAst.getText(); + log(ast.getLineNo(), message); + } + } + } + +} diff --git a/src/test/java/teetime/examples/cipher/CipherConfiguration.java b/src/test/java/teetime/examples/cipher/CipherConfiguration.java index 6192ad227144e28d6a2f5735c52567104043fb5e..64dbbb0bd3918397ec0c31134dca9346bc116575 100644 --- a/src/test/java/teetime/examples/cipher/CipherConfiguration.java +++ b/src/test/java/teetime/examples/cipher/CipherConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,6 @@ package teetime.examples.cipher; import java.io.File; import teetime.framework.AnalysisConfiguration; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CipherByteArray; import teetime.stage.CipherByteArray.CipherMode; import teetime.stage.InitialElementProducer; @@ -43,14 +40,12 @@ public class CipherConfiguration extends AnalysisConfiguration { final CipherByteArray decrypt = new CipherByteArray(password, CipherMode.DECRYPT); final ByteArrayFileWriter writer = new ByteArrayFileWriter(output); - final IPipeFactory intraFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); - - intraFactory.create(init.getOutputPort(), f2b.getInputPort()); - intraFactory.create(f2b.getOutputPort(), enc.getInputPort()); - intraFactory.create(enc.getOutputPort(), comp.getInputPort()); - intraFactory.create(comp.getOutputPort(), decomp.getInputPort()); - intraFactory.create(decomp.getOutputPort(), decrypt.getInputPort()); - intraFactory.create(decrypt.getOutputPort(), writer.getInputPort()); + connectIntraThreads(init.getOutputPort(), f2b.getInputPort()); + connectIntraThreads(f2b.getOutputPort(), enc.getInputPort()); + connectIntraThreads(enc.getOutputPort(), comp.getInputPort()); + connectIntraThreads(comp.getOutputPort(), decomp.getInputPort()); + connectIntraThreads(decomp.getOutputPort(), decrypt.getInputPort()); + connectIntraThreads(decrypt.getOutputPort(), writer.getInputPort()); // this.getFiniteProducerStages().add(init); this.addThreadableStage(init); diff --git a/src/test/java/teetime/examples/cipher/CipherTest.java b/src/test/java/teetime/examples/cipher/CipherTest.java index 963980e48fb4d1810a03b9cd024c064dcfafcd49..ac03de784a47b3a892d4ecdf9724898965a0ff1f 100644 --- a/src/test/java/teetime/examples/cipher/CipherTest.java +++ b/src/test/java/teetime/examples/cipher/CipherTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public class CipherTest { final AnalysisConfiguration configuration = new CipherConfiguration(inputFile, outputFile, password); final Analysis analysis = new Analysis(configuration); - analysis.start(); + analysis.executeBlocking(); Assert.assertTrue(Files.equal(new File(inputFile), new File(outputFile))); } diff --git a/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java b/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java index 05bc367b8a953b691cd09b6e9c2bfe247816ce83..129cdd4fca5665eebcb832534c024ae8ad5d4b0f 100644 --- a/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java +++ b/src/test/java/teetime/examples/tokenizer/TokenizerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,6 @@ package teetime.examples.tokenizer; import java.io.File; import teetime.framework.AnalysisConfiguration; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.ByteArray2String; import teetime.stage.CipherByteArray; import teetime.stage.CipherByteArray.CipherMode; @@ -33,7 +30,6 @@ import teetime.stage.string.Tokenizer; public class TokenizerConfiguration extends AnalysisConfiguration { - private static final IPipeFactory INTRA_PIPE_FACTORY = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); private final Counter<String> counter; public TokenizerConfiguration(final String inputFile, final String password) { @@ -47,20 +43,13 @@ public class TokenizerConfiguration extends AnalysisConfiguration { final Tokenizer tokenizer = new Tokenizer(" "); this.counter = new Counter<String>(); - INTRA_PIPE_FACTORY.create( - init.getOutputPort(), f2b.getInputPort()); - INTRA_PIPE_FACTORY.create( - f2b.getOutputPort(), decomp.getInputPort()); - INTRA_PIPE_FACTORY.create( - decomp.getOutputPort(), decrypt.getInputPort()); - INTRA_PIPE_FACTORY.create( - decrypt.getOutputPort(), b2s.getInputPort()); - INTRA_PIPE_FACTORY.create( - b2s.getOutputPort(), tokenizer.getInputPort()); - INTRA_PIPE_FACTORY.create( - tokenizer.getOutputPort(), this.counter.getInputPort()); + connectIntraThreads(init.getOutputPort(), f2b.getInputPort()); + connectIntraThreads(f2b.getOutputPort(), decomp.getInputPort()); + connectIntraThreads(decomp.getOutputPort(), decrypt.getInputPort()); + connectIntraThreads(decrypt.getOutputPort(), b2s.getInputPort()); + connectIntraThreads(b2s.getOutputPort(), tokenizer.getInputPort()); + connectIntraThreads(tokenizer.getOutputPort(), this.counter.getInputPort()); - // this.getFiniteProducerStages().add(init); this.addThreadableStage(init); } diff --git a/src/test/java/teetime/examples/tokenizer/TokenizerTest.java b/src/test/java/teetime/examples/tokenizer/TokenizerTest.java index 86e5cc950965eba19ba745a64178dd00005a174f..b1396eae30773290f18e1a5aa0a511c63d1280dc 100644 --- a/src/test/java/teetime/examples/tokenizer/TokenizerTest.java +++ b/src/test/java/teetime/examples/tokenizer/TokenizerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ public class TokenizerTest { final TokenizerConfiguration configuration = new TokenizerConfiguration(inputFile, password); final Analysis analysis = new Analysis(configuration); - analysis.start(); + analysis.executeBlocking(); final String string = Files.toString(new File("src/test/resources/data/input.txt"), Charset.forName("UTF-8")); diff --git a/src/test/java/teetime/framework/AnalysisTest.java b/src/test/java/teetime/framework/AnalysisTest.java new file mode 100644 index 0000000000000000000000000000000000000000..f9905c60a8fac7d41cb99320757d98a05dc6f8fa --- /dev/null +++ b/src/test/java/teetime/framework/AnalysisTest.java @@ -0,0 +1,101 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework; + +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.lessThan; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +import teetime.stage.InitialElementProducer; +import teetime.util.StopWatch; + +public class AnalysisTest { + + private static final long DELAY_IN_MS = 500; + private static final long ABSOLUTE_MAX_ERROR_IN_MS = 2; + + private Analysis<TestConfig> analysis; + + @Before + public void before() { + TestConfig configuration = new TestConfig(); + analysis = new Analysis<TestConfig>(configuration); + } + + @Test + public void testExecuteNonBlocking() throws Exception { + StopWatch watch = new StopWatch(); + watch.start(); + analysis.executeNonBlocking(); + watch.end(); + + assertThat(watch.getDurationInMs(), is(lessThan(DELAY_IN_MS))); + assertFalse(analysis.getConfiguration().delay.finished); + + analysis.waitForTermination(); + assertTrue(analysis.getConfiguration().delay.finished); + } + + @Test + public void testExecuteBlocking() { + StopWatch watch = new StopWatch(); + watch.start(); + analysis.executeBlocking(); + watch.end(); + + assertThat(watch.getDurationInMs() + ABSOLUTE_MAX_ERROR_IN_MS, is(greaterThanOrEqualTo(DELAY_IN_MS))); + } + + private static class TestConfig extends AnalysisConfiguration { + public final DelayAndTerminate delay; + + public TestConfig() { + final InitialElementProducer<String> init = new InitialElementProducer<String>("Hello"); + delay = new DelayAndTerminate(DELAY_IN_MS); + connectIntraThreads(init.getOutputPort(), delay.getInputPort()); + addThreadableStage(init); + } + } + + private static class DelayAndTerminate extends AbstractConsumerStage<String> { + + private final long delayInMs; + + public boolean finished; + + public DelayAndTerminate(final long delayInMs) { + super(); + this.delayInMs = delayInMs; + } + + @Override + protected void execute(final String element) { + try { + Thread.sleep(delayInMs); + } catch (InterruptedException e) { + } + finished = true; + } + + } + +} diff --git a/src/test/java/teetime/framework/ExceptionHandling.java b/src/test/java/teetime/framework/ExceptionHandling.java deleted file mode 100644 index c0d0610f7a887468116706105e712c503fa1ed65..0000000000000000000000000000000000000000 --- a/src/test/java/teetime/framework/ExceptionHandling.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.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 teetime.framework; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Before; -import org.junit.Test; - -import teetime.framework.exceptionHandling.TestListener; - -public class ExceptionHandling { - - private Class<TestListener> listener; - private Analysis analysis; - - @Before - public void newInstances() { - listener = TestListener.class; - analysis = new Analysis(new ExceptionTestConfiguration(), listener); - } - - @Test(timeout = 5000, expected = RuntimeException.class) - public void exceptionPassingAndTermination() { - analysis.execute(); - assertEquals(TestListener.exceptionInvoked, 2); // listener did not kill thread to early - } - - @Test - public void terminatesAllStages() { - // TODO: more than one stage and check, if all are terminated (at least 3, each of every terminationtype) - assertTrue(true); - } -} diff --git a/src/test/java/teetime/framework/RunnableConsumerStageTest.java b/src/test/java/teetime/framework/RunnableConsumerStageTest.java index b96a3a61717567045efde776a3fc36e111312ea6..5be8ef32e1ace9e38c468d41984df0b5bc016ecc 100644 --- a/src/test/java/teetime/framework/RunnableConsumerStageTest.java +++ b/src/test/java/teetime/framework/RunnableConsumerStageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package teetime.framework; import static org.junit.Assert.assertEquals; import java.lang.Thread.State; +import java.util.ArrayList; import java.util.Collection; import org.junit.Ignore; @@ -117,7 +118,12 @@ public class RunnableConsumerStageTest { } private void start(final Analysis analysis) { - Collection<Pair<Thread, Throwable>> exceptions = analysis.start(); + Collection<Pair<Thread, Throwable>> exceptions = new ArrayList<Pair<Thread, Throwable>>(); + try { + analysis.executeBlocking(); + } catch (AnalysisException e) { + exceptions = e.getThrownExceptions(); + } for (Pair<Thread, Throwable> pair : exceptions) { System.err.println(pair.getSecond()); System.err.println(Joiner.on("\n").join(pair.getSecond().getStackTrace())); diff --git a/src/test/java/teetime/framework/RunnableConsumerStageTestConfiguration.java b/src/test/java/teetime/framework/RunnableConsumerStageTestConfiguration.java index 71769300a748b81d1a7e9fc8d817bcacebda9c20..892c3cd0de01cd336d150f66e418535b2d439ed1 100644 --- a/src/test/java/teetime/framework/RunnableConsumerStageTestConfiguration.java +++ b/src/test/java/teetime/framework/RunnableConsumerStageTestConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,9 +18,6 @@ package teetime.framework; import java.util.ArrayList; import java.util.List; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CollectorSink; import teetime.stage.InitialElementProducer; @@ -38,8 +35,7 @@ public class RunnableConsumerStageTestConfiguration extends AnalysisConfiguratio CollectorSink<Integer> collectorSink = new CollectorSink<Integer>(collectedElements); addThreadableStage(collectorSink); - IPipeFactory pipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, false); - pipeFactory.create(producer.getOutputPort(), collectorSink.getInputPort()); + connectBoundedInterThreads(producer.getOutputPort(), collectorSink.getInputPort()); this.collectorSink = collectorSink; } diff --git a/src/test/java/teetime/framework/StageTest.java b/src/test/java/teetime/framework/StageTest.java index c6f03a091afbfb708620ac10b5688332fa095331..5fcc1dfee8718ee9335dab311cb93bb363a3cc84 100644 --- a/src/test/java/teetime/framework/StageTest.java +++ b/src/test/java/teetime/framework/StageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,11 +15,17 @@ */ package teetime.framework; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + import org.junit.Assert; import org.junit.Test; import teetime.stage.Cache; import teetime.stage.Counter; +import teetime.stage.InitialElementProducer; public class StageTest { @@ -38,4 +44,47 @@ public class StageTest { } } + @Test + public void testSetOwningThread() throws Exception { + TestConfig tc = new TestConfig(); + new Analysis<TestConfig>(tc); + assertEquals(tc.init.owningThread, tc.delay.owningThread); + assertThat(tc.delay.exceptionHandler, is(notNullValue())); + assertEquals(tc.init.exceptionHandler, tc.delay.exceptionHandler); + } + + private static class TestConfig extends AnalysisConfiguration { + public final DelayAndTerminate delay; + public InitialElementProducer<String> init; + + public TestConfig() { + init = new InitialElementProducer<String>("Hello"); + delay = new DelayAndTerminate(0); + connectIntraThreads(init.getOutputPort(), delay.getInputPort()); + addThreadableStage(init); + } + } + + private static class DelayAndTerminate extends AbstractConsumerStage<String> { + + private final long delayInMs; + + public boolean finished; + + public DelayAndTerminate(final long delayInMs) { + super(); + this.delayInMs = delayInMs; + } + + @Override + protected void execute(final String element) { + try { + Thread.sleep(delayInMs); + } catch (InterruptedException e) { + } + finished = true; + } + + } + } diff --git a/src/test/java/teetime/framework/TraversorTest.java b/src/test/java/teetime/framework/TraversorTest.java new file mode 100644 index 0000000000000000000000000000000000000000..9f4ef25077219463a7ea4c4df72ba4082b89f94d --- /dev/null +++ b/src/test/java/teetime/framework/TraversorTest.java @@ -0,0 +1,96 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework; + +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +import org.junit.Test; + +import teetime.framework.pipe.IPipe; +import teetime.stage.CountingMapMerger; +import teetime.stage.InitialElementProducer; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.basic.distributor.RoundRobinStrategy2; +import teetime.stage.basic.merger.Merger; +import teetime.stage.io.File2SeqOfWords; +import teetime.stage.string.WordCounter; +import teetime.stage.util.CountingMap; + +public class TraversorTest { + + private final Traversor traversor = new Traversor(new IntraStageCollector()); + + @Test + public void traverse() { + TestConfiguration tc = new TestConfiguration(); + traversor.traverse(tc.init); + Set<Stage> comparingSet = new HashSet<Stage>(); + comparingSet.add(tc.init); + comparingSet.add(tc.f2b); + comparingSet.add(tc.distributor); + assertTrue(comparingSet.equals(traversor.getVisitedStage())); + } + + // WordCounterConfiguration + private class TestConfiguration extends AnalysisConfiguration { + + public final CountingMapMerger<String> result = new CountingMapMerger<String>(); + public final InitialElementProducer<File> init; + public final File2SeqOfWords f2b; + public Distributor<String> distributor; + + public TestConfiguration() { + int threads = 2; + init = new InitialElementProducer<File>(new File("")); + f2b = new File2SeqOfWords("UTF-8", 512); + distributor = new Distributor<String>(new RoundRobinStrategy2()); + + // last part + final Merger<CountingMap<String>> merger = new Merger<CountingMap<String>>(); + // CountingMapMerger (already as field) + + // Connecting the stages of the first part of the config + connectIntraThreads(init.getOutputPort(), f2b.getInputPort()); + connectIntraThreads(f2b.getOutputPort(), distributor.getInputPort()); + + // Middle part... multiple instances of WordCounter are created and connected to the merger and distrubuter stages + for (int i = 0; i < threads; i++) { + // final InputPortSizePrinter<String> inputPortSizePrinter = new InputPortSizePrinter<String>(); + final WordCounter wc = new WordCounter(); + // intraFact.create(inputPortSizePrinter.getOutputPort(), wc.getInputPort()); + + final IPipe distributorPipe = connectBoundedInterThreads(distributor.getNewOutputPort(), wc.getInputPort(), 10000); + final IPipe mergerPipe = connectBoundedInterThreads(wc.getOutputPort(), merger.getNewInputPort()); + // Add WordCounter as a threadable stage, so it runs in its own thread + addThreadableStage(wc); + + } + + // Connect the stages of the last part + connectIntraThreads(merger.getOutputPort(), result.getInputPort()); + + // Add the first and last part to the threadable stages + addThreadableStage(init); + addThreadableStage(merger); + } + + } + +} diff --git a/src/test/java/teetime/framework/WaitStrategyConfiguration.java b/src/test/java/teetime/framework/WaitStrategyConfiguration.java index 3c491ac30fbef84331e8b1523a21f2c9a9e9cbe1..4d4dff162c62b5b719effb511beceff0148f32a1 100644 --- a/src/test/java/teetime/framework/WaitStrategyConfiguration.java +++ b/src/test/java/teetime/framework/WaitStrategyConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,6 @@ */ package teetime.framework; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.Clock; import teetime.stage.CollectorSink; import teetime.stage.InitialElementProducer; @@ -26,15 +23,10 @@ import teetime.stage.basic.Delay; class WaitStrategyConfiguration extends AnalysisConfiguration { - private final IPipeFactory intraThreadPipeFactory; - private final IPipeFactory interThreadPipeFactory; - private Delay<Object> delay; private CollectorSink<Object> collectorSink; public WaitStrategyConfiguration(final long initialDelayInMs, final Object... elements) { - intraThreadPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); - interThreadPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, false); Stage producer = buildProducer(elements); addThreadableStage(producer); @@ -50,7 +42,7 @@ class WaitStrategyConfiguration extends AnalysisConfiguration { Clock clock = new Clock(); clock.setInitialDelayInMs(initialDelayInMs); - interThreadPipeFactory.create(clock.getOutputPort(), delay.getTimestampTriggerInputPort()); + connectBoundedInterThreads(clock.getOutputPort(), delay.getTimestampTriggerInputPort()); return clock; } @@ -59,7 +51,7 @@ class WaitStrategyConfiguration extends AnalysisConfiguration { InitialElementProducer<Object> initialElementProducer = new InitialElementProducer<Object>(elements); delay = new Delay<Object>(); - intraThreadPipeFactory.create(initialElementProducer.getOutputPort(), delay.getInputPort()); + connectIntraThreads(initialElementProducer.getOutputPort(), delay.getInputPort()); return initialElementProducer; } @@ -70,8 +62,8 @@ class WaitStrategyConfiguration extends AnalysisConfiguration { // relay.setIdleStrategy(new WaitStrategy(relay)); - interThreadPipeFactory.create(delay.getOutputPort(), relay.getInputPort()); - intraThreadPipeFactory.create(relay.getOutputPort(), collectorSink.getInputPort()); + connectBoundedInterThreads(delay.getOutputPort(), relay.getInputPort()); + connectIntraThreads(relay.getOutputPort(), collectorSink.getInputPort()); this.collectorSink = collectorSink; diff --git a/src/test/java/teetime/framework/YieldStrategyConfiguration.java b/src/test/java/teetime/framework/YieldStrategyConfiguration.java index 4047b9a9134a67e0c618282d8c79ae20e0c47607..f3e48a4d32c21c1e8bf1c01087657593e4d54099 100644 --- a/src/test/java/teetime/framework/YieldStrategyConfiguration.java +++ b/src/test/java/teetime/framework/YieldStrategyConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,22 +15,15 @@ */ package teetime.framework; -import teetime.framework.pipe.IPipeFactory; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; import teetime.stage.CollectorSink; import teetime.stage.InitialElementProducer; import teetime.stage.Relay; class YieldStrategyConfiguration extends AnalysisConfiguration { - private final IPipeFactory intraThreadPipeFactory; - private final IPipeFactory interThreadPipeFactory; private CollectorSink<Object> collectorSink; public YieldStrategyConfiguration(final Object... elements) { - intraThreadPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); - interThreadPipeFactory = PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, false); InitialElementProducer<Object> producer = buildProducer(elements); addThreadableStage(producer); @@ -51,8 +44,8 @@ class YieldStrategyConfiguration extends AnalysisConfiguration { // relay.setIdleStrategy(new YieldStrategy()); - interThreadPipeFactory.create(producer.getOutputPort(), relay.getInputPort()); - intraThreadPipeFactory.create(relay.getOutputPort(), collectorSink.getInputPort()); + connectBoundedInterThreads(producer.getOutputPort(), relay.getInputPort()); + connectIntraThreads(relay.getOutputPort(), collectorSink.getInputPort()); this.collectorSink = collectorSink; diff --git a/src/test/java/teetime/framework/exceptionHandling/ExceptionHandlingTest.java b/src/test/java/teetime/framework/exceptionHandling/ExceptionHandlingTest.java new file mode 100644 index 0000000000000000000000000000000000000000..1dc02f2b55cfaf73c64b4a87956be187807520d3 --- /dev/null +++ b/src/test/java/teetime/framework/exceptionHandling/ExceptionHandlingTest.java @@ -0,0 +1,73 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework.exceptionHandling; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import teetime.framework.Analysis; +import teetime.framework.AnalysisException; +import teetime.framework.StageState; + +public class ExceptionHandlingTest { + + private Analysis<ExceptionTestConfiguration> analysis; + + public ExceptionTestConfiguration newInstances() { + ExceptionTestConfiguration configuration = new ExceptionTestConfiguration(); + analysis = new Analysis<ExceptionTestConfiguration>(configuration, new TestListenerFactory()); + return configuration; + } + + public void exceptionPassingAndTermination() { + newInstances(); + analysis.executeBlocking(); + assertEquals(TestListener.exceptionInvoked, 2); // listener did not kill thread too early + } + + public void terminatesAllStages() { + ExceptionTestConfiguration config = newInstances(); + analysis.executeBlocking(); + assertThat(config.first.getCurrentState(), is(StageState.TERMINATED)); + assertThat(config.second.getCurrentState(), is(StageState.TERMINATED)); + assertThat(config.third.getCurrentState(), is(StageState.TERMINATED)); + } + + @Test + public void forAFewTimes() { + for (int i = 0; i < 100; i++) { + boolean exceptionArised = false; + try { + exceptionPassingAndTermination(); + } catch (AnalysisException e) { + exceptionArised = true; + } + assertTrue(exceptionArised); + + exceptionArised = false; + try { + terminatesAllStages(); + } catch (AnalysisException e) { + exceptionArised = true; + } + assertTrue(exceptionArised); + } + } +} diff --git a/src/test/java/teetime/framework/ExceptionTestConfiguration.java b/src/test/java/teetime/framework/exceptionHandling/ExceptionTestConfiguration.java similarity index 58% rename from src/test/java/teetime/framework/ExceptionTestConfiguration.java rename to src/test/java/teetime/framework/exceptionHandling/ExceptionTestConfiguration.java index ebd89aed6e9b9209e72f4d1366fe4d1c7753c276..a9a1d1dfbbea2638d1c5886566426c250f2f1a0e 100644 --- a/src/test/java/teetime/framework/ExceptionTestConfiguration.java +++ b/src/test/java/teetime/framework/exceptionHandling/ExceptionTestConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,20 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package teetime.framework; +package teetime.framework.exceptionHandling; -import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; -import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication; +import teetime.framework.AnalysisConfiguration; public class ExceptionTestConfiguration extends AnalysisConfiguration { + ExceptionTestProducerStage first; + ExceptionTestConsumerStage second; + ExceptionTestProducerStage third; + public ExceptionTestConfiguration() { - ExceptionTestProducerStage first = new ExceptionTestProducerStage(); - ExceptionTestConsumerStage second = new ExceptionTestConsumerStage(); - ExceptionTestProducerStage third = new ExceptionTestProducerStage(); + first = new ExceptionTestProducerStage(); + second = new ExceptionTestConsumerStage(); + third = new ExceptionTestProducerStage(); - PIPE_FACTORY_REGISTRY.getPipeFactory(ThreadCommunication.INTER, PipeOrdering.QUEUE_BASED, false) - .create(first.getOutputPort(), second.getInputPort()); + connectBoundedInterThreads(first.getOutputPort(), second.getInputPort()); // this.addThreadableStage(new ExceptionTestStage()); this.addThreadableStage(first); diff --git a/src/test/java/teetime/framework/ExceptionTestConsumerStage.java b/src/test/java/teetime/framework/exceptionHandling/ExceptionTestConsumerStage.java similarity index 82% rename from src/test/java/teetime/framework/ExceptionTestConsumerStage.java rename to src/test/java/teetime/framework/exceptionHandling/ExceptionTestConsumerStage.java index ff0cc3302e642d934cea4f6d3d20cbf1f7db6346..96b00352925b69ba7c7bd2fa233c17640a4a99e3 100644 --- a/src/test/java/teetime/framework/ExceptionTestConsumerStage.java +++ b/src/test/java/teetime/framework/exceptionHandling/ExceptionTestConsumerStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package teetime.framework; +package teetime.framework.exceptionHandling; + +import teetime.framework.AbstractConsumerStage; public class ExceptionTestConsumerStage extends AbstractConsumerStage<Object> { diff --git a/src/test/java/teetime/framework/ExceptionTestProducerStage.java b/src/test/java/teetime/framework/exceptionHandling/ExceptionTestProducerStage.java similarity index 71% rename from src/test/java/teetime/framework/ExceptionTestProducerStage.java rename to src/test/java/teetime/framework/exceptionHandling/ExceptionTestProducerStage.java index aa4ceb28374c54a1f906b993cf01cac10a2bf8e8..2bc6bc824c8fc8ad8199d7cff3c339215916ada9 100644 --- a/src/test/java/teetime/framework/ExceptionTestProducerStage.java +++ b/src/test/java/teetime/framework/exceptionHandling/ExceptionTestProducerStage.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package teetime.framework; +package teetime.framework.exceptionHandling; + +import teetime.framework.AbstractProducerStage; +import teetime.framework.InputPort; +import teetime.framework.TerminationStrategy; public class ExceptionTestProducerStage extends AbstractProducerStage<Object> { @@ -43,10 +47,9 @@ public class ExceptionTestProducerStage extends AbstractProducerStage<Object> { @Override protected void execute() { getOutputPort().send(new Object()); - if (numberOfExecutions >= 10000) { + if (numberOfExecutions++ >= 10000 && strategy == TerminationStrategy.BY_SELF_DECISION) { this.terminate(); } - numberOfExecutions++; } @Override @@ -54,4 +57,11 @@ public class ExceptionTestProducerStage extends AbstractProducerStage<Object> { return strategy; } + @Override + public String getId() { + if (strategy == TerminationStrategy.BY_INTERRUPT) { + return "Infinite" + super.getId(); + } + return "Finite" + super.getId(); + } } diff --git a/src/test/java/teetime/framework/exceptionHandling/TestListener.java b/src/test/java/teetime/framework/exceptionHandling/TestListener.java index e39022ab88635d9e4e925b869596bb1f0e78e04a..35eeb813af4c54ec98ff0b11898d0ff1f4f38722 100644 --- a/src/test/java/teetime/framework/exceptionHandling/TestListener.java +++ b/src/test/java/teetime/framework/exceptionHandling/TestListener.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,14 @@ package teetime.framework.exceptionHandling; import teetime.framework.Stage; -public class TestListener extends StageExceptionHandler { +public class TestListener extends AbstractExceptionListener { public static int exceptionInvoked = 0; + public TestListener() { + TestListener.exceptionInvoked = 0; + } + @Override public FurtherExecution onStageException(final Exception e, final Stage throwingStage) { exceptionInvoked++; diff --git a/src/test/java/teetime/framework/exceptionHandling/TestListenerFactory.java b/src/test/java/teetime/framework/exceptionHandling/TestListenerFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..642fdd59dcf39fbd6672d847e89e9c17d65c040b --- /dev/null +++ b/src/test/java/teetime/framework/exceptionHandling/TestListenerFactory.java @@ -0,0 +1,25 @@ +/** + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.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 teetime.framework.exceptionHandling; + +public class TestListenerFactory implements IExceptionListenerFactory { + + @Override + public AbstractExceptionListener create() { + return new TestListener(); + } + +} diff --git a/src/test/java/teetime/framework/pipe/DummyFactory.java b/src/test/java/teetime/framework/pipe/DummyFactory.java index 4d2b328cf52caf4c206b3be75c7b117781d43a77..58559bde53093033311772a50c9c7734628442c4 100644 --- a/src/test/java/teetime/framework/pipe/DummyFactory.java +++ b/src/test/java/teetime/framework/pipe/DummyFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/framework/pipe/PipeFactoryLoaderTest.java b/src/test/java/teetime/framework/pipe/PipeFactoryLoaderTest.java index 833027a2be250ec9a7147c3d9af498c3abd3dd35..f6418cc01c8b19a660c997129a57819e9396c45b 100644 --- a/src/test/java/teetime/framework/pipe/PipeFactoryLoaderTest.java +++ b/src/test/java/teetime/framework/pipe/PipeFactoryLoaderTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/framework/pipe/SpScPipeTest.java b/src/test/java/teetime/framework/pipe/SpScPipeTest.java index b82dcbbcd18f2e376b5f5d469905b6aa86c0627d..cfb3e4f8d27381a0faf668b38115eaa087303856 100644 --- a/src/test/java/teetime/framework/pipe/SpScPipeTest.java +++ b/src/test/java/teetime/framework/pipe/SpScPipeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/CipherByteArrayTest.java b/src/test/java/teetime/stage/CipherByteArrayTest.java index 14f8ce976d31c3ae37182e397b42e1160d7de77a..ee1dcd68f8306d65799e4301153f04dded0c7049 100644 --- a/src/test/java/teetime/stage/CipherByteArrayTest.java +++ b/src/test/java/teetime/stage/CipherByteArrayTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/CounterTest.java b/src/test/java/teetime/stage/CounterTest.java index a93d1fb54d67ce43f0ac81e65769fab9a7acaadb..0f2da227139a0eb8a4b083d4ea916793bf9f38f1 100644 --- a/src/test/java/teetime/stage/CounterTest.java +++ b/src/test/java/teetime/stage/CounterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/EveryXthStageTest.java b/src/test/java/teetime/stage/EveryXthStageTest.java index 72b965b70f08db5ae31d3e40fb55ae45d9a5a6f4..4cbb3558f0b53ec48c119b4d00a9bd0a9a19e947 100644 --- a/src/test/java/teetime/stage/EveryXthStageTest.java +++ b/src/test/java/teetime/stage/EveryXthStageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/InitialElementProducerTest.java b/src/test/java/teetime/stage/InitialElementProducerTest.java index c3d505ee95f162bad9611ac2a1577d33a7413668..c748a9bdc971445b76edce2cb67800cd54145ce6 100644 --- a/src/test/java/teetime/stage/InitialElementProducerTest.java +++ b/src/test/java/teetime/stage/InitialElementProducerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/InstanceCounterTest.java b/src/test/java/teetime/stage/InstanceCounterTest.java index d533085c63949b296d2a231c99ed00fad94d6f56..65ee1b09187a408a444ec8da4f61157c49df9329 100644 --- a/src/test/java/teetime/stage/InstanceCounterTest.java +++ b/src/test/java/teetime/stage/InstanceCounterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/InstanceOfFilterTest.java b/src/test/java/teetime/stage/InstanceOfFilterTest.java index ea1e93b644ffb88c48184c1a2a37e8d403afeb2d..186ce0c44fe7017f5bfd2be494f67d539f254db0 100644 --- a/src/test/java/teetime/stage/InstanceOfFilterTest.java +++ b/src/test/java/teetime/stage/InstanceOfFilterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,11 +23,17 @@ import static org.junit.Assert.assertThat; import static teetime.framework.test.StageTester.test; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import org.junit.Before; import org.junit.Test; +import teetime.framework.Analysis; +import teetime.framework.AnalysisConfiguration; +import teetime.framework.AnalysisException; +import teetime.util.Pair; + /** * @author Nils Christian Ehmke */ @@ -45,7 +51,10 @@ public class InstanceOfFilterTest { final List<Clazz> results = new ArrayList<InstanceOfFilterTest.Clazz>(); final Object clazz = new Clazz(); - test(filter).and().send(clazz).to(filter.getInputPort()).and().receive(results).from(filter.getMatchedOutputPort()).start(); + test(filter) + .and().send(clazz).to(filter.getInputPort()) + .and().receive(results).from(filter.getMatchedOutputPort()) + .start(); assertThat(results, contains(clazz)); } @@ -55,7 +64,10 @@ public class InstanceOfFilterTest { final List<Clazz> results = new ArrayList<InstanceOfFilterTest.Clazz>(); final Object clazz = new SubClazz(); - test(filter).and().send(clazz).to(filter.getInputPort()).and().receive(results).from(filter.getMatchedOutputPort()).start(); + test(filter) + .and().send(clazz).to(filter.getInputPort()) + .and().receive(results).from(filter.getMatchedOutputPort()) + .start(); assertThat(results, contains(clazz)); } @@ -65,7 +77,10 @@ public class InstanceOfFilterTest { final List<Clazz> results = new ArrayList<InstanceOfFilterTest.Clazz>(); final Object object = new Object(); - test(filter).and().send(object).to(filter.getInputPort()).and().receive(results).from(filter.getMatchedOutputPort()).start(); + test(filter) + .and().send(object).to(filter.getInputPort()) + .and().receive(results).from(filter.getMatchedOutputPort()) + .start(); assertThat(results, is(empty())); } @@ -81,7 +96,10 @@ public class InstanceOfFilterTest { input.add(new SubClazz()); input.add(new Object()); - test(filter).and().send(input).to(filter.getInputPort()).and().receive(results).from(filter.getMatchedOutputPort()).start(); + test(filter) + .and().send(input).to(filter.getInputPort()) + .and().receive(results).from(filter.getMatchedOutputPort()) + .start(); assertThat(results, hasSize(2)); } @@ -92,4 +110,32 @@ public class InstanceOfFilterTest { private static class SubClazz extends Clazz { } + @Test + public void filterShouldSendToBothOutputPorts() throws Exception { + InstanceOfFilterTestConfig config = new InstanceOfFilterTestConfig(); + Analysis analysis = new Analysis(config); + try { + analysis.executeBlocking(); + } catch (AnalysisException e) { + Collection<Pair<Thread, Throwable>> thrownExceptions = e.getThrownExceptions(); + // TODO: handle exception + } + } + + private static class InstanceOfFilterTestConfig extends AnalysisConfiguration { + + public InstanceOfFilterTestConfig() { + InitialElementProducer<Object> elementProducer = new InitialElementProducer<Object>(); + InstanceOfFilter<Object, Clazz> instanceOfFilter = new InstanceOfFilter<Object, Clazz>(Clazz.class); + CollectorSink<Clazz> clazzCollector = new CollectorSink<Clazz>(); + CollectorSink<Object> mismatchedCollector = new CollectorSink<Object>(); + + connectIntraThreads(elementProducer.getOutputPort(), instanceOfFilter.getInputPort()); + connectIntraThreads(instanceOfFilter.getMatchedOutputPort(), clazzCollector.getInputPort()); + connectIntraThreads(instanceOfFilter.getMismatchedOutputPort(), mismatchedCollector.getInputPort()); + + addThreadableStage(elementProducer); + } + } + } diff --git a/src/test/java/teetime/stage/MappingCounterTest.java b/src/test/java/teetime/stage/MappingCounterTest.java index b34dbfaf3610cef73d9829254469d80e92d6c1cc..5ee94a978c395ef203151c546b8631bf477bbefe 100644 --- a/src/test/java/teetime/stage/MappingCounterTest.java +++ b/src/test/java/teetime/stage/MappingCounterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/MultipleInstanceOfFilterTest.java b/src/test/java/teetime/stage/MultipleInstanceOfFilterTest.java index 4513ebaa04093363a9aafe9ec44605cdc0d5427d..3654feddc788773efc5f7fd7401b626c9b1ff3e9 100644 --- a/src/test/java/teetime/stage/MultipleInstanceOfFilterTest.java +++ b/src/test/java/teetime/stage/MultipleInstanceOfFilterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/ObjectProducerTest.java b/src/test/java/teetime/stage/ObjectProducerTest.java index a623248aff4764344be81c1ae25167c3aee2b6d0..242060a629ad28f67b9677318bb5670f74ef95c4 100644 --- a/src/test/java/teetime/stage/ObjectProducerTest.java +++ b/src/test/java/teetime/stage/ObjectProducerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/RelayTest.java b/src/test/java/teetime/stage/RelayTest.java index 2304be43c8b37840d37b3a280df1651bab27273c..c001f6850575878d8f3fe50370eee6a5d66c9b2f 100644 --- a/src/test/java/teetime/stage/RelayTest.java +++ b/src/test/java/teetime/stage/RelayTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/basic/distributor/DistributorTest.java b/src/test/java/teetime/stage/basic/distributor/DistributorTest.java index 30c80e6ab4f507c370469bd1437a2f49ab3fbe5e..9f40fe64b7bd57b0466e1f70f37ea3d91bbdb337 100644 --- a/src/test/java/teetime/stage/basic/distributor/DistributorTest.java +++ b/src/test/java/teetime/stage/basic/distributor/DistributorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/basic/merger/MergerSignalTest.java b/src/test/java/teetime/stage/basic/merger/MergerSignalTest.java index f4deb2bc2553ecb911ab49c33e46d1379896e670..b1967bcd43e5f40cf1556907bed08dfe161ffb41 100644 --- a/src/test/java/teetime/stage/basic/merger/MergerSignalTest.java +++ b/src/test/java/teetime/stage/basic/merger/MergerSignalTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/basic/merger/MergerTest.java b/src/test/java/teetime/stage/basic/merger/MergerTest.java index 7a8546090157a8195799a53abfd11861109ed605..e85129480b4284ab9f26655752f5d9078a23d202 100644 --- a/src/test/java/teetime/stage/basic/merger/MergerTest.java +++ b/src/test/java/teetime/stage/basic/merger/MergerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import static org.junit.Assert.assertThat; import static teetime.framework.test.StageTester.test; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import org.junit.Before; @@ -33,7 +32,6 @@ import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.SingleElementPipeFactory; import teetime.stage.CollectorSink; import teetime.stage.InitialElementProducer; -import teetime.util.Pair; /** * @author Nils Christian Ehmke @@ -86,13 +84,12 @@ public class MergerTest { mergerUnderTest = new Merger<Integer>(new RoundRobinStrategy()); List<Integer> outputList = new ArrayList<Integer>(); - Collection<Pair<Thread, Throwable>> exceptions = test(mergerUnderTest) + test(mergerUnderTest) .and().send(1, 2, 3).to(mergerUnderTest.getNewInputPort()) .and().send(4, 5, 6).to(mergerUnderTest.getNewInputPort()) .and().receive(outputList).from(mergerUnderTest.getOutputPort()) .start(); - assertThat(exceptions, is(empty())); assertThat(outputList, is(not(empty()))); assertThat(outputList, contains(1, 4, 2, 5, 3, 6)); } diff --git a/src/test/java/teetime/stage/basic/merger/MergerTestingPipe.java b/src/test/java/teetime/stage/basic/merger/MergerTestingPipe.java index 9defb4511cadc946b212a1f857f3ffb2c464a712..1499b91c2f3450547b9ef7df15f60bdbefaed94d 100644 --- a/src/test/java/teetime/stage/basic/merger/MergerTestingPipe.java +++ b/src/test/java/teetime/stage/basic/merger/MergerTestingPipe.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/string/ToLowerCaseTest.java b/src/test/java/teetime/stage/string/ToLowerCaseTest.java index 02e6d9b028998ae8fbfe0797342cc46026e76d67..871e86b9a4da359c62829654278cd5fd51adb46b 100644 --- a/src/test/java/teetime/stage/string/ToLowerCaseTest.java +++ b/src/test/java/teetime/stage/string/ToLowerCaseTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/stage/string/TokenizerTest.java b/src/test/java/teetime/stage/string/TokenizerTest.java index cadbcb8a43c3cbce27eeba32bc586984df55516b..efaa0be6630b1e48d3104bbb50e062d1187de246 100644 --- a/src/test/java/teetime/stage/string/TokenizerTest.java +++ b/src/test/java/teetime/stage/string/TokenizerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/teetime/util/classpath/FileSearcherTest.java b/src/test/java/teetime/util/classpath/FileSearcherTest.java index 62499ed120030ce07e8f2ff9817f7a4ff76fc44f..b79e6fa7ebd11dc07118f41d8d71144d2eb7e111 100644 --- a/src/test/java/teetime/util/classpath/FileSearcherTest.java +++ b/src/test/java/teetime/util/classpath/FileSearcherTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/util/test/AbstractProfiledPerformanceAssertion.java b/src/test/java/util/test/AbstractProfiledPerformanceAssertion.java index 5d62d695744eca506d1619560904ae5d6161058c..e5981c58b1b72c8ba6fa2953954f16b86a861acf 100644 --- a/src/test/java/util/test/AbstractProfiledPerformanceAssertion.java +++ b/src/test/java/util/test/AbstractProfiledPerformanceAssertion.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/util/test/MeasurementRepository.java b/src/test/java/util/test/MeasurementRepository.java index 0c01463da3d8ab2f7b44a72fe67cd447c7248db8..e19fe7a6db4e2fc9ff61f01f293d0e8714166881 100644 --- a/src/test/java/util/test/MeasurementRepository.java +++ b/src/test/java/util/test/MeasurementRepository.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/util/test/PerformanceCheckProfileRepository.java b/src/test/java/util/test/PerformanceCheckProfileRepository.java index 02f274e3aae27035cc786f5d9fb1b159b766a845..fbefc401c0addc4529f1a21ef1c0acc8ed4c3cc6 100644 --- a/src/test/java/util/test/PerformanceCheckProfileRepository.java +++ b/src/test/java/util/test/PerformanceCheckProfileRepository.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/util/test/PerformanceTest.java b/src/test/java/util/test/PerformanceTest.java index 59ff3ba6e456a3ab5f9753aa65c2d68a2fb16259..0bb3c3fe23251adc170402824d5ea7eeb4e11e8b 100644 --- a/src/test/java/util/test/PerformanceTest.java +++ b/src/test/java/util/test/PerformanceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net) + * Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.