Skip to content
Snippets Groups Projects
Commit b278f833 authored by Christian Wulf's avatar Christian Wulf
Browse files

moved logger properties file to the corresponding maven folder;

replaced kieker by logback logger in PerformanceTest;
added performance check for test 01
parent b2cb66b6
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,8 @@
</attributes>
</classpathentry>
<classpathentry kind="src" path="conf"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
......
.handlers = java.util.logging.ConsoleHandler
.level = WARNING
java.util.logging.ConsoleHandler.level = ALL
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=[%1$tF %1$tr] %4$s: %5$s (%2$s) %6$s %n
#teetime.level = ALL
#teetime.variant.methodcallWithPorts.framework.level = ALL
#teetime.variant.methodcallWithPorts.framework.core.level = FINE
teetime.variant.methodcallWithPorts.stage.level = INFO
#teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads.level = FINE
teetime.variant.methodcallWithPorts.examples.kiekerdays.level = FINE
......@@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
......@@ -14,8 +15,6 @@ import org.junit.runner.Description;
import teetime.util.StopWatch;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import kieker.common.logging.LogFactory;
public abstract class PerformanceTest {
protected static final int NUM_OBJECTS_TO_CREATE = 100000;
......@@ -28,6 +27,11 @@ public abstract class PerformanceTest {
protected StopWatch stopWatch;
protected List<TimestampObject> timestampObjects;
@BeforeClass
public static void beforeClass() {
System.setProperty("logback.configurationFile", "src/test/resources/logback-test.groovy");
}
@Rule
public final TestRule watcher = new TestWatcher() {
@Override
......@@ -39,7 +43,6 @@ public abstract class PerformanceTest {
@Before
public void before() {
System.setProperty(LogFactory.CUSTOM_LOGGER_JVM, "NONE");
this.stopWatch = new StopWatch();
this.timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
}
......@@ -56,4 +59,5 @@ public abstract class PerformanceTest {
System.out.println("[" + TimeUnit.NANOSECONDS.toMicros(performanceResult.avgDurInNs - performanceResult.confidenceWidthInNs) + " µs, "
+ TimeUnit.NANOSECONDS.toMicros(performanceResult.avgDurInNs + performanceResult.confidenceWidthInNs) + " µs]");
}
}
File moved
package teetime.variant.methodcall.examples.experiment01;
import static org.junit.Assert.assertEquals;
import util.PerformanceCheckProfile;
import util.PerformanceResult;
import util.PerformanceTest;
public class ChwHomePerformanceCheck implements PerformanceCheckProfile {
@Override
public String getCorrespondingPerformanceProfile() {
return "ChwHome";
}
@Override
public void check() {
PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults
.get("testWithManyObjects(teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)");
assertEquals(292, test01.quantiles.get(0.5), 1);
}
}
package teetime.variant.methodcall.examples.experiment01;
import static org.junit.Assert.assertEquals;
import util.PerformanceCheckProfile;
import util.PerformanceResult;
import util.PerformanceTest;
public class ChwWorkPerformanceCheck implements PerformanceCheckProfile {
@Override
public String getCorrespondingPerformanceProfile() {
return "ChwWork";
}
@Override
public void check() {
PerformanceResult test01 = PerformanceTest.measurementRepository.performanceResults
.get("testWithManyObjects(teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)");
assertEquals(410, test01.quantiles.get(0.5), 1);
}
}
......@@ -15,23 +15,35 @@
***************************************************************************/
package teetime.variant.methodcall.examples.experiment01;
import static org.junit.Assert.assertEquals;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import teetime.util.ConstructorClosure;
import teetime.variant.explicitScheduling.examples.throughput.TimestampObject;
import util.PerformanceResult;
import util.PerformanceCheckProfile;
import util.PerformanceCheckProfileRepository;
import util.PerformanceTest;
import util.StatisticsUtil;
/**
* @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() {
PerformanceCheckProfile 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
......@@ -56,9 +68,6 @@ public class MethodCallThoughputTimestampAnalysis1Test extends PerformanceTest {
} finally {
this.stopWatch.end();
}
PerformanceResult performanceResult = StatisticsUtil.computeStatistics(this.stopWatch.getDurationInNs(), this.timestampObjects);
assertEquals(292, performanceResult.quantiles.get(0.5), 1); // chw home
}
}
......@@ -7,6 +7,11 @@ import util.PerformanceTest;
public class ChwHomePerformanceCheck implements PerformanceCheckProfile {
@Override
public String getCorrespondingPerformanceProfile() {
return "ChwHome";
}
@Override
public void check() {
PerformanceResult test16a = PerformanceTest.measurementRepository.performanceResults
......@@ -25,9 +30,4 @@ public class ChwHomePerformanceCheck implements PerformanceCheckProfile {
assertEquals(2, speedupB, 0.3);
assertEquals(3, speedupC, 0.3);
}
@Override
public String getCorrespondingPerformanceProfile() {
return "ChwHome";
}
}
import ch.qos.logback.classic.filter.ThresholdFilter
statusListener(OnConsoleStatusListener)
appender("FILE", FileAppender) {
file = "src/test/data/load-logs/timings-results.txt"
append = false
filter(ThresholdFilter) {
level = INFO
}
encoder(PatternLayoutEncoder) {
pattern = "%msg%n"
}
}
appender("CONSOLE", ConsoleAppender) {
encoder(PatternLayoutEncoder) {
pattern = "%d{HH:mm:ss.SSS} %level %logger - %msg%n"
}
}
root ERROR, ["CONSOLE"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment