Skip to content
Snippets Groups Projects
Commit fd7689e8 authored by Sören Henning's avatar Sören Henning
Browse files

graphml writing is working

parent 9901c5e4
No related branches found
No related tags found
2 merge requests!17Get impletemented stages and Java 8,!16Trace aggr analysis graph migration
Pipeline #
......@@ -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());
/*
*
......
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;
}
}
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