diff --git a/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java b/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java index 8fa261c34d2650da8ecbb52f1f337a14d5773f81..a7934deae3e6bcb0c875848117a4b116f5db389e 100644 --- a/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java +++ b/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java @@ -7,13 +7,13 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import kieker.analysis.dev.DependencyCreatorStage; -import kieker.analysis.dev.DependencyStatisticsDecoratorStage; import kieker.analysis.domain.AggregatedOperationCall; import kieker.analysis.domain.AggregatedTrace; import kieker.analysis.domain.OperationCall; import kieker.analysis.domain.Trace; import kieker.analysis.graph.Graph; +import kieker.analysis.graph.export.graphml.GraphMLFileWriterComposite; +import kieker.analysis.graph.mapping.SimpleFileNameMapper; import kieker.analysis.stage.tracediagnosis.AllowedRecordsFilter; import kieker.analysis.stage.tracediagnosis.BeginEndOfMonitoringDetector; import kieker.analysis.stage.tracediagnosis.OperationCallHandlerComposite; @@ -21,7 +21,6 @@ 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.TraceTraverserStage; import kieker.common.record.IMonitoringRecord; @@ -77,31 +76,33 @@ public class TraceAnalysisConfiguration extends Configuration { TraceTraverserStage traceTraverserStage = new TraceTraverserStage(); final Distributor<Graph> graphDistributor = new Distributor<>(new CopyByReferenceStrategy()); - GraphMLWriter graphMLWriter = new GraphMLWriter(graphFilesOutputDir); + // TODO create mapping object + GraphMLFileWriterComposite graphMLFileWriterComposite = new GraphMLFileWriterComposite(new SimpleFileNameMapper(graphFilesOutputDir, "xml")); 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(), graphMLFileWriterComposite.getInputPort()); // super.connectPorts(graphDistributor.getNewOutputPort(), dotGraphWriter.getInputPort()); final Distributor<AggregatedTrace> aggregatedTraceDistributor = new Distributor<>(new CopyByReferenceStrategy()); AggrTraceTraverserStage aggrTraceTraverser = new AggrTraceTraverserStage(); final Distributor<Graph> graphDistributor2 = new Distributor<>(new CopyByReferenceStrategy()); - GraphMLWriter graphMLWriter2 = new GraphMLWriter(graphFilesOutputDir); - DotGraphWriter dotGraphWriter2 = new DotGraphWriter(graphFilesOutputDir); + // TODO create mapping object + GraphMLFileWriterComposite graphMLFileWriterComposite2 = new GraphMLFileWriterComposite(new SimpleFileNameMapper(graphFilesOutputDir, "xml")); + // DotGraphWriter dotGraphWriter2 = new DotGraphWriter(graphFilesOutputDir); super.connectPorts(aggregation.getOutputPort(), aggregatedTraceDistributor.getInputPort()); super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), aggrTraceTraverser.getInputPort()); super.connectPorts(aggrTraceTraverser.getOutputPort(), graphDistributor2.getInputPort()); - // super.connectPorts(graphDistributor2.getNewOutputPort(), graphMLWriter2.getInputPort()); + super.connectPorts(graphDistributor2.getNewOutputPort(), graphMLFileWriterComposite2.getInputPort()); // super.connectPorts(graphDistributor2.getNewOutputPort(), dotGraphWriter2.getInputPort()); - DependencyCreatorStage dependencyCreatorStage = new DependencyCreatorStage(); - DependencyStatisticsDecoratorStage dependencyStatisticsDecoratorStage = new DependencyStatisticsDecoratorStage(); - super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), dependencyCreatorStage.getInputPort()); - super.connectPorts(dependencyCreatorStage.getOutputPort(), dependencyStatisticsDecoratorStage.getInputPort()); + // DependencyCreatorStage dependencyCreatorStage = new DependencyCreatorStage(); + // DependencyStatisticsDecoratorStage dependencyStatisticsDecoratorStage = new DependencyStatisticsDecoratorStage(); + // super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), dependencyCreatorStage.getInputPort()); + // super.connectPorts(dependencyCreatorStage.getOutputPort(), dependencyStatisticsDecoratorStage.getInputPort()); /* * diff --git a/src/main/java/kieker/analysis/graph/mapping/SimpleFileNameMapper.java b/src/main/java/kieker/analysis/graph/mapping/SimpleFileNameMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..066edda6435427cd24017d693c49a2b8b8d7132d --- /dev/null +++ b/src/main/java/kieker/analysis/graph/mapping/SimpleFileNameMapper.java @@ -0,0 +1,27 @@ +package kieker.analysis.graph.mapping; + +import kieker.analysis.graph.Graph; + +/** + * This mapper maps a graph to a file name with the pattern: + * output directory + graph name + file extension + * + * @author Sören Henning + * + */ +public class SimpleFileNameMapper implements GraphMapper<String> { + + private final String outputDirectory; + private final String fileExtension; + + public SimpleFileNameMapper(final String outputDirectory, final String fileExtension) { + this.outputDirectory = outputDirectory; + this.fileExtension = fileExtension; + } + + @Override + public String map(final Graph graph) { + return outputDirectory + '/' + graph.getName() + '.' + fileExtension; + } + +}