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

fixed compiler errors

parent 45c89eb0
No related branches found
No related tags found
No related merge requests found
#FindBugs User Preferences #FindBugs User Preferences
#Wed Dec 17 09:02:35 CET 2014 #Wed Dec 17 15:04:09 CET 2014
detector_threshold=3 detector_threshold=3
effort=max effort=max
excludefilter0=.fbExcludeFilterFile|true excludefilter0=.fbExcludeFilterFile|true
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="teetime.examples.ComparisonMethodcallWithPorts"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="teetime.examples.ComparisonMethodcallWithPorts"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="teetime"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="teetime"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration> </launchConfiguration>
...@@ -14,7 +14,7 @@ import java.util.Collection; ...@@ -14,7 +14,7 @@ import java.util.Collection;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import teetime.framework.RunnableProducerStage; import teetime.framework.RunnableStage;
import teetime.framework.Stage; import teetime.framework.Stage;
import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry;
...@@ -34,13 +34,13 @@ import kieker.common.util.registry.Registry; ...@@ -34,13 +34,13 @@ import kieker.common.util.registry.Registry;
public class KiekerLoadDriver { public class KiekerLoadDriver {
private final List<IMonitoringRecord> elementCollection = new LinkedList<IMonitoringRecord>(); private final List<IMonitoringRecord> elementCollection = new LinkedList<IMonitoringRecord>();
private final RunnableProducerStage runnableStage; private final RunnableStage runnableStage;
private long[] timings; private long[] timings;
private final IPipeFactory intraThreadPipeFactory; private final IPipeFactory intraThreadPipeFactory;
public KiekerLoadDriver(final File directory) { public KiekerLoadDriver(final File directory) {
Stage producerPipeline = this.buildProducerPipeline(directory); Stage producerPipeline = this.buildProducerPipeline(directory);
runnableStage = new RunnableProducerStage(producerPipeline); runnableStage = new RunnableStage(producerPipeline);
intraThreadPipeFactory = PipeFactoryRegistry.INSTANCE.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false); intraThreadPipeFactory = PipeFactoryRegistry.INSTANCE.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false);
} }
......
package teetime.examples.kiekerdays; package teetime.examples.kiekerdays;
import teetime.framework.Stage; import teetime.framework.Stage;
import teetime.framework.RunnableProducerStage; import teetime.framework.RunnableStage;
import teetime.stage.io.network.TcpReader; import teetime.stage.io.network.TcpReader;
public class TcpTraceLogging { public class TcpTraceLogging {
...@@ -10,7 +10,7 @@ public class TcpTraceLogging { ...@@ -10,7 +10,7 @@ public class TcpTraceLogging {
public void init() { public void init() {
Stage tcpPipeline = this.buildTcpPipeline(); Stage tcpPipeline = this.buildTcpPipeline();
this.tcpThread = new Thread(new RunnableProducerStage(tcpPipeline)); this.tcpThread = new Thread(new RunnableStage(tcpPipeline));
} }
public void start() { public void start() {
......
package teetime.examples.kiekerdays; package teetime.examples.kiekerdays;
import teetime.framework.Stage; import teetime.framework.Stage;
import teetime.framework.RunnableProducerStage; import teetime.framework.RunnableStage;
import teetime.framework.pipe.SingleElementPipe; import teetime.framework.pipe.SingleElementPipe;
import teetime.stage.basic.Sink; import teetime.stage.basic.Sink;
import teetime.stage.explorviz.KiekerRecordTcpReader; import teetime.stage.explorviz.KiekerRecordTcpReader;
...@@ -14,7 +14,7 @@ public class TcpTraceLoggingExplorviz { ...@@ -14,7 +14,7 @@ public class TcpTraceLoggingExplorviz {
public void init() { public void init() {
Stage tcpPipeline = this.buildTcpPipeline(); Stage tcpPipeline = this.buildTcpPipeline();
this.tcpThread = new Thread(new RunnableProducerStage(tcpPipeline)); this.tcpThread = new Thread(new RunnableStage(tcpPipeline));
} }
public void start() { public void start() {
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
import teetime.framework.Stage; import teetime.framework.Stage;
import teetime.framework.Pipeline; import teetime.framework.Pipeline;
import teetime.framework.RunnableProducerStage; import teetime.framework.RunnableStage;
import teetime.framework.pipe.IPipe; import teetime.framework.pipe.IPipe;
import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry;
...@@ -51,14 +51,14 @@ public class TcpTraceReconstruction { ...@@ -51,14 +51,14 @@ public class TcpTraceReconstruction {
public void init() { public void init() {
Pipeline<Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline(); Pipeline<Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline();
this.tcpThread = new Thread(new RunnableProducerStage(tcpPipeline)); this.tcpThread = new Thread(new RunnableStage(tcpPipeline));
this.numWorkerThreads = Math.min(NUM_VIRTUAL_CORES, this.numWorkerThreads); this.numWorkerThreads = Math.min(NUM_VIRTUAL_CORES, this.numWorkerThreads);
this.workerThreads = new Thread[this.numWorkerThreads]; this.workerThreads = new Thread[this.numWorkerThreads];
for (int i = 0; i < this.workerThreads.length; i++) { for (int i = 0; i < this.workerThreads.length; i++) {
Stage pipeline = this.buildPipeline(tcpPipeline.getLastStage()); Stage pipeline = this.buildPipeline(tcpPipeline.getLastStage());
this.workerThreads[i] = new Thread(new RunnableProducerStage(pipeline)); this.workerThreads[i] = new Thread(new RunnableStage(pipeline));
} }
} }
......
...@@ -8,7 +8,7 @@ import java.util.TreeMap; ...@@ -8,7 +8,7 @@ import java.util.TreeMap;
import teetime.framework.Stage; import teetime.framework.Stage;
import teetime.framework.Pipeline; import teetime.framework.Pipeline;
import teetime.framework.RunnableProducerStage; import teetime.framework.RunnableStage;
import teetime.framework.pipe.IPipe; import teetime.framework.pipe.IPipe;
import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry; import teetime.framework.pipe.PipeFactoryRegistry;
...@@ -59,17 +59,17 @@ public class TcpTraceReduction { ...@@ -59,17 +59,17 @@ public class TcpTraceReduction {
public void init() { public void init() {
Pipeline<Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline(); Pipeline<Distributor<IMonitoringRecord>> tcpPipeline = this.buildTcpPipeline();
this.tcpThread = new Thread(new RunnableProducerStage(tcpPipeline)); this.tcpThread = new Thread(new RunnableStage(tcpPipeline));
Pipeline<Distributor<Long>> clockStage = this.buildClockPipeline(5000); Pipeline<Distributor<Long>> clockStage = this.buildClockPipeline(5000);
this.clockThread = new Thread(new RunnableProducerStage(clockStage)); this.clockThread = new Thread(new RunnableStage(clockStage));
this.numWorkerThreads = Math.min(NUM_VIRTUAL_CORES, this.numWorkerThreads); this.numWorkerThreads = Math.min(NUM_VIRTUAL_CORES, this.numWorkerThreads);
this.workerThreads = new Thread[this.numWorkerThreads]; this.workerThreads = new Thread[this.numWorkerThreads];
for (int i = 0; i < this.workerThreads.length; i++) { for (int i = 0; i < this.workerThreads.length; i++) {
Stage pipeline = this.buildPipeline(tcpPipeline.getLastStage(), clockStage.getLastStage()); Stage pipeline = this.buildPipeline(tcpPipeline.getLastStage(), clockStage.getLastStage());
this.workerThreads[i] = new Thread(new RunnableProducerStage(pipeline)); this.workerThreads[i] = new Thread(new RunnableStage(pipeline));
} }
} }
......
...@@ -5,7 +5,7 @@ import java.util.LinkedList; ...@@ -5,7 +5,7 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import teetime.framework.AnalysisConfiguration; import teetime.framework.AnalysisConfiguration;
import teetime.framework.RunnableProducerStage; import teetime.framework.RunnableStage;
import teetime.framework.Stage; import teetime.framework.Stage;
import teetime.framework.pipe.IPipeFactory; import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering; import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
...@@ -59,10 +59,10 @@ public class TraceReconstructionAnalysis extends AnalysisConfiguration { ...@@ -59,10 +59,10 @@ public class TraceReconstructionAnalysis extends AnalysisConfiguration {
private void init() { private void init() {
Clock clockStage = this.buildClockPipeline(); Clock clockStage = this.buildClockPipeline();
this.clockThread = new Thread(new RunnableProducerStage(clockStage)); this.clockThread = new Thread(new RunnableStage(clockStage));
Stage pipeline = this.buildPipeline(clockStage); Stage pipeline = this.buildPipeline(clockStage);
this.workerThread = new Thread(new RunnableProducerStage(pipeline)); this.workerThread = new Thread(new RunnableStage(pipeline));
} }
private Clock buildClockPipeline() { private Clock buildClockPipeline() {
......
package util.test;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import teetime.util.StopWatch;
import teetime.util.TimestampObject;
public abstract class PerformanceTest {
protected static final PerformanceCheckProfileRepository PERFORMANCE_CHECK_PROFILE_REPOSITORY = PerformanceCheckProfileRepository.INSTANCE;
protected static final int NUM_OBJECTS_TO_CREATE = 1000000;
protected static final int NUM_NOOP_FILTERS = 800;
public static final MeasurementRepository MEASUREMENT_REPOSITORY = new MeasurementRepository();
protected Description description;
protected StopWatch stopWatch;
protected List<TimestampObject> timestampObjects;
static {
System.setProperty("logback.configurationFile", "src/test/resources/logback.groovy");
}
@Rule
public final TestRule watcher = new TestWatcher() {
@Override
protected void starting(final Description description) {
PerformanceTest.this.description = description;
// System.out.println("getDisplayName(): " + description.getDisplayName());
}
};
@Before
public void before() {
this.stopWatch = new StopWatch();
this.timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE);
}
@After
public void after() {
String testMethodIdentifier = MeasurementRepository.buildTestMethodIdentifier(description.getTestClass(), description.getMethodName());
PerformanceResult performanceResult = StatisticsUtil.computeStatistics(this.stopWatch.getDurationInNs(), this.timestampObjects);
MEASUREMENT_REPOSITORY.performanceResults.put(testMethodIdentifier, performanceResult);
addToRepository(performanceResult);
System.out.println("Duration: " + TimeUnit.NANOSECONDS.toMillis(performanceResult.overallDurationInNs) + " ms");
System.out.println("avg duration: " + TimeUnit.NANOSECONDS.toMicros(performanceResult.avgDurInNs) + " µs");
System.out.println(StatisticsUtil.getQuantilesString(performanceResult.quantiles));
System.out.println("confidenceWidth: " + performanceResult.confidenceWidthInNs + " ns");
System.out.println("[" + TimeUnit.NANOSECONDS.toMicros(performanceResult.avgDurInNs - performanceResult.confidenceWidthInNs) + " µs, "
+ TimeUnit.NANOSECONDS.toMicros(performanceResult.avgDurInNs + performanceResult.confidenceWidthInNs) + " µs]");
}
@Deprecated
private void addToRepository(final PerformanceResult performanceResult) {
MEASUREMENT_REPOSITORY.performanceResults.put(this.description.getDisplayName(), performanceResult);
}
}
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