diff --git a/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java b/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java index 72d8f9a658f56d318d11e22fcdbaecc119759950..dc851b1a8b42ebea7cf1b7c1be1f4b5195a9bef4 100644 --- a/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java +++ b/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java @@ -13,6 +13,11 @@ import kieker.analysis.stage.tracediagnosis.OperationCallHandlerComposite; import kieker.analysis.stage.tracediagnosis.ReadingComposite; import kieker.analysis.stage.tracediagnosis.TraceAggregationComposite; import kieker.analysis.stage.tracediagnosis.TraceReconstructionComposite; +import kieker.analysis.trace.graphoutput.DotGraphWriter; +import kieker.analysis.trace.graphoutput.GraphMLWriter; +import kieker.analysis.trace.traversal.AggrTraceTraverserStage; +import kieker.analysis.trace.traversal.NamedGraph; +import kieker.analysis.trace.traversal.TraceTraverserStage; import kieker.analysis.traceanalysisdomain.AggregatedOperationCall; import kieker.analysis.traceanalysisdomain.AggregatedTrace; import kieker.analysis.traceanalysisdomain.OperationCall; @@ -32,6 +37,8 @@ import teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy; public class TraceAnalysisConfiguration extends Configuration { + // TODO Clean up + private final List<Trace> traces = new ArrayList<>(1000); private final List<OperationCall> operationCalls = new ArrayList<>(1000); private final List<AggregatedOperationCall> aggregatedOperationCalls = new ArrayList<>(1000); @@ -65,6 +72,43 @@ public class TraceAnalysisConfiguration extends Configuration { super.connectPorts(distributor.getNewOutputPort(), operationCallHandler.getInputPort()); super.connectPorts(distributor.getNewOutputPort(), aggregation.getInputPort()); super.connectPorts(typeFilter.getOutputPortForType(KiekerMetadataRecord.class), metadataCollector.getInputPort()); + + // TODO move to own composite + + String graphFilesOutputDir = "example/event monitoring log/output"; // TODO Temp hard coded + + TraceTraverserStage traceTraverserStage = new TraceTraverserStage(); + final Distributor<NamedGraph> graphDistributor = new Distributor<>(new CopyByReferenceStrategy()); + GraphMLWriter graphMLWriter = new GraphMLWriter(graphFilesOutputDir); + DotGraphWriter dotGraphWriter = new DotGraphWriter(graphFilesOutputDir); + + AggrTraceTraverserStage aggrTraceTraverser = new AggrTraceTraverserStage(); + final Distributor<NamedGraph> graphDistributor2 = new Distributor<>(new CopyByReferenceStrategy()); + GraphMLWriter graphMLWriter2 = new GraphMLWriter(graphFilesOutputDir); + DotGraphWriter dotGraphWriter2 = new DotGraphWriter(graphFilesOutputDir); + + super.connectPorts(distributor.getNewOutputPort(), traceTraverserStage.getInputPort()); + super.connectPorts(traceTraverserStage.getOutputPort(), graphDistributor.getInputPort()); + super.connectPorts(graphDistributor.getNewOutputPort(), graphMLWriter.getInputPort()); + super.connectPorts(graphDistributor.getNewOutputPort(), dotGraphWriter.getInputPort()); + + super.connectPorts(aggregation.getOutputPort(), aggrTraceTraverser.getInputPort()); + super.connectPorts(aggrTraceTraverser.getOutputPort(), graphDistributor2.getInputPort()); + super.connectPorts(graphDistributor2.getNewOutputPort(), graphMLWriter2.getInputPort()); + super.connectPorts(graphDistributor2.getNewOutputPort(), dotGraphWriter2.getInputPort()); + + // TODO Temp Some examples for nested graphs + + /* + * final NestedGraphFactory nestedGraphFactory = new NestedGraphFactory(); + * final ObjectProducer<PartitionGraph<Graph>> nestedGraphProducerStage = new ObjectProducer<>(1, nestedGraphFactory); + * // final NestedGraphMLWriter nestedGraphMLWriter = new NestedGraphMLWriter("example/temp/output"); + * final NestedGraphPrinterStage nestedGraphPrinterStage = new NestedGraphPrinterStage(); + * + * super.connectPorts(nestedGraphProducerStage.getOutputPort(), nestedGraphPrinterStage.getInputPort()); + * // super.connectPorts(nestedGraphProducerStage.getOutputPort(), nestedGraphMLWriter.getInputPort()); + */ + } public long getBeginTimestamp() { diff --git a/src/main/java/kieker/analysis/stage/tracediagnosis/TraceAggregationComposite.java b/src/main/java/kieker/analysis/stage/tracediagnosis/TraceAggregationComposite.java index 72dd5d48b839bb4e6ad95c6265eff7c222492bbb..606b2bf7ad0f0710c5ee64c49b050bd8004816fb 100644 --- a/src/main/java/kieker/analysis/stage/tracediagnosis/TraceAggregationComposite.java +++ b/src/main/java/kieker/analysis/stage/tracediagnosis/TraceAggregationComposite.java @@ -18,18 +18,12 @@ package kieker.analysis.stage.tracediagnosis; import java.util.List; -import kieker.analysis.trace.graphoutput.DotGraphWriter; -import kieker.analysis.trace.graphoutput.GraphMLWriter; -import kieker.analysis.trace.traversal.AggrTraceTraverserStage; -import kieker.analysis.trace.traversal.NamedGraph; import kieker.analysis.traceanalysisdomain.AggregatedTrace; import kieker.analysis.traceanalysisdomain.Trace; import teetime.framework.AbstractCompositeStage; import teetime.framework.InputPort; -import teetime.stage.CollectorSink; -import teetime.stage.basic.distributor.Distributor; -import teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy; +import teetime.framework.OutputPort; /** * This is a composite {@code TeeTime} stage which aggregates incoming traces, adds statistical data and stores the aggregated traces. @@ -38,40 +32,28 @@ import teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy; */ public final class TraceAggregationComposite extends AbstractCompositeStage { + // TODO Maybe remove CollectorSink because its not longer necessary + private final TraceAggregator aggregator; - private final CollectorSink<AggregatedTrace> tracesCollector; + // private final CollectorSink<AggregatedTrace> tracesCollector; private final AggregatedTraceStatisticsDecorator statisticsDecorator; public TraceAggregationComposite(final List<AggregatedTrace> traces) { this.aggregator = new TraceAggregator(); this.statisticsDecorator = new AggregatedTraceStatisticsDecorator(); - this.tracesCollector = new CollectorSink<>(traces); + // this.tracesCollector = new CollectorSink<>(traces); super.connectPorts(this.aggregator.getOutputPort(), this.statisticsDecorator.getInputPort()); // super.connectPorts(this.statisticsDecorator.getOutputPort(), this.tracesCollector.getInputPort()); - // TODO New from Sören - // TODO Move to own composite - - String graphFilesOutputDir = "example/event monitoring log/output"; // TODO Temp hard coded - - final Distributor<AggregatedTrace> distributor = new Distributor<>(new CopyByReferenceStrategy()); - AggrTraceTraverserStage aggrTraceTraverser = new AggrTraceTraverserStage(); - final Distributor<NamedGraph> graphDistributor = new Distributor<>(new CopyByReferenceStrategy()); - GraphMLWriter graphMLWriter = new GraphMLWriter(graphFilesOutputDir); - DotGraphWriter dotGraphWriter = new DotGraphWriter(graphFilesOutputDir); - - super.connectPorts(this.statisticsDecorator.getOutputPort(), distributor.getInputPort()); - super.connectPorts(distributor.getNewOutputPort(), this.tracesCollector.getInputPort()); - super.connectPorts(distributor.getNewOutputPort(), aggrTraceTraverser.getInputPort()); - super.connectPorts(aggrTraceTraverser.getOutputPort(), graphDistributor.getInputPort()); - super.connectPorts(graphDistributor.getNewOutputPort(), graphMLWriter.getInputPort()); - super.connectPorts(graphDistributor.getNewOutputPort(), dotGraphWriter.getInputPort()); - } public InputPort<Trace> getInputPort() { return this.aggregator.getInputPort(); } + public OutputPort<AggregatedTrace> getOutputPort() { + return this.statisticsDecorator.getOutputPort(); + } + } diff --git a/src/main/java/kieker/analysis/stage/tracediagnosis/TraceReconstructionComposite.java b/src/main/java/kieker/analysis/stage/tracediagnosis/TraceReconstructionComposite.java index cb5d9462a3fc53144d0717370f23dbc3c1d0115e..7f38b068ecac64385e96de13f55fd779b89e45ce 100644 --- a/src/main/java/kieker/analysis/stage/tracediagnosis/TraceReconstructionComposite.java +++ b/src/main/java/kieker/analysis/stage/tracediagnosis/TraceReconstructionComposite.java @@ -18,10 +18,6 @@ package kieker.analysis.stage.tracediagnosis; import java.util.List; -import kieker.analysis.trace.graphoutput.DotGraphWriter; -import kieker.analysis.trace.graphoutput.GraphMLWriter; -import kieker.analysis.trace.traversal.NamedGraph; -import kieker.analysis.trace.traversal.TraceTraverserStage; import kieker.analysis.traceanalysisdomain.Trace; import kieker.common.record.IMonitoringRecord; import kieker.common.record.controlflow.OperationExecutionRecord; @@ -43,6 +39,8 @@ import teetime.stage.basic.merger.Merger; */ public final class TraceReconstructionComposite extends AbstractCompositeStage { + // TODO Maybe remove CollectorSink because its not longer necessary + private final MultipleInstanceOfFilter<IMonitoringRecord> typeFilter; private final CollectorSink<Trace> tracesCollector; private final TraceStatisticsDecorator statisticsDecorator; @@ -70,21 +68,6 @@ public final class TraceReconstructionComposite extends AbstractCompositeStage { super.connectPorts(distributor.getNewOutputPort(), this.tracesCollector.getInputPort()); super.connectPorts(distributor.getNewOutputPort(), this.statisticsDecorator.getInputPort()); - // TODO New from Sören - // TODO move to own composite - - String graphFilesOutputDir = "example/event monitoring log/output"; // TODO Temp hard coded - - TraceTraverserStage traceTraverserStage = new TraceTraverserStage(); - final Distributor<NamedGraph> graphDistributor = new Distributor<>(new CopyByReferenceStrategy()); - GraphMLWriter graphMLWriter = new GraphMLWriter(graphFilesOutputDir); - DotGraphWriter dotGraphWriter = new DotGraphWriter(graphFilesOutputDir); - - super.connectPorts(distributor.getNewOutputPort(), traceTraverserStage.getInputPort()); - super.connectPorts(traceTraverserStage.getOutputPort(), graphDistributor.getInputPort()); - super.connectPorts(graphDistributor.getNewOutputPort(), graphMLWriter.getInputPort()); - super.connectPorts(graphDistributor.getNewOutputPort(), dotGraphWriter.getInputPort()); - } public int countIncompleteTraces() {