diff --git a/.settings/edu.umd.cs.findbugs.core.prefs b/.settings/edu.umd.cs.findbugs.core.prefs index 8e771b991692be5cdd94d793667744e2efe0a2e2..b338b3668eb43e8353b2f4b89af954c6354b46a5 100644 --- a/.settings/edu.umd.cs.findbugs.core.prefs +++ b/.settings/edu.umd.cs.findbugs.core.prefs @@ -1,5 +1,5 @@ #FindBugs User Preferences -#Fri Dec 19 11:02:39 CET 2014 +#Fri Dec 19 11:06:26 CET 2014 detector_threshold=3 effort=max excludefilter0=.fbExcludeFilterFile|true diff --git a/src/main/java/teetime/stage/io/network/TcpReader.java b/src/main/java/teetime/stage/io/network/TcpReader.java index 668234f541a4062ab88f30a2e74bd0f71745aa93..bd9e5c523d05ef231d83d8ab3421976dfac98f3c 100644 --- a/src/main/java/teetime/stage/io/network/TcpReader.java +++ b/src/main/java/teetime/stage/io/network/TcpReader.java @@ -25,6 +25,8 @@ import java.nio.channels.SocketChannel; import teetime.stage.io.AbstractTcpReader; +import com.google.common.base.Joiner; + import kieker.common.exception.RecordInstantiationException; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; @@ -87,9 +89,9 @@ public class TcpReader extends AbstractTcpReader<IMonitoringRecord> { outputPort.send(record); } catch (final BufferUnderflowException ex) { - super.logger.error("Failed to create record.", ex); + super.logger.error("Failed to create: " + recordClassName, ex); } catch (final RecordInstantiationException ex) { - super.logger.error("Failed to create record.", ex); + super.logger.error("Failed to create: " + recordClassName, ex); } } @@ -145,6 +147,7 @@ public class TcpReader extends AbstractTcpReader<IMonitoringRecord> { while (buffer.hasRemaining()) { buffer.mark(); RegistryRecord.registerRecordInRegistry(buffer, this.stringRegistry); + System.out.println("NEW: " + Joiner.on("\n").join(stringRegistry.getAll())); } buffer.clear(); } catch (final BufferUnderflowException ex) { diff --git a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java deleted file mode 100644 index 226b9baf69b8df5cea8ddc4f4de0a69a4f8725f3..0000000000000000000000000000000000000000 --- a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLogging.java +++ /dev/null @@ -1,44 +0,0 @@ -package teetime.examples.kiekerdays; - -import teetime.framework.Stage; -import teetime.framework.RunnableStage; -import teetime.stage.io.network.TcpReader; - -public class TcpTraceLogging { - - private Thread tcpThread; - - public void init() { - Stage tcpPipeline = this.buildTcpPipeline(); - this.tcpThread = new Thread(new RunnableStage(tcpPipeline)); - } - - public void start() { - - this.tcpThread.start(); - - try { - this.tcpThread.join(); - } catch (InterruptedException e) { - throw new IllegalStateException(e); - } - } - - private Stage buildTcpPipeline() { - // TCPReaderSink tcpReader = new TCPReaderSink(); - TcpReader tcpReader = new TcpReader(); - - return tcpReader; - } - - public static void main(final String[] args) { - final TcpTraceLogging analysis = new TcpTraceLogging(); - - analysis.init(); - try { - analysis.start(); - } finally { - } - } - -} diff --git a/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingConfiguration.java b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..52a051ce98dfef3e993edd56512a96baedb291d3 --- /dev/null +++ b/src/performancetest/java/teetime/examples/kiekerdays/TcpTraceLoggingConfiguration.java @@ -0,0 +1,37 @@ +package teetime.examples.kiekerdays; + +import java.util.Collection; + +import teetime.framework.Analysis; +import teetime.framework.AnalysisConfiguration; +import teetime.framework.Stage; +import teetime.stage.io.network.TcpReader; +import teetime.util.Pair; + +public class TcpTraceLoggingConfiguration extends AnalysisConfiguration { + + public TcpTraceLoggingConfiguration() { + Stage tcpPipeline = this.buildTcpPipeline(); + addThreadableStage(tcpPipeline); + } + + private Stage buildTcpPipeline() { + // TCPReaderSink tcpReader = new TCPReaderSink(); + TcpReader tcpReader = new TcpReader(); + + return tcpReader; + } + + public static void main(final String[] args) { + final TcpTraceLoggingConfiguration configuration = new TcpTraceLoggingConfiguration(); + + Analysis analysis = new Analysis(configuration); + analysis.init(); + Collection<Pair<Thread, Throwable>> exceptions = analysis.start(); + + if (!exceptions.isEmpty()) { + throw new IllegalStateException(); + } + } + +}