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

Update dot export styles

parent 6e4181ef
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
Pipeline #
......@@ -17,10 +17,10 @@ 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.DotTraceGraphFileWriterStage;
import kieker.analysis.trace.traversal.AggrTraceTraverserStage;
import kieker.analysis.trace.traversal.TraceTraverserStage;
import kieker.analysis.util.graph.Graph;
import kieker.analysis.util.graph.export.dot.DotFileWriterStage;
import kieker.analysis.util.graph.export.graphml.GraphMLFileWriterStage;
import kieker.common.record.IMonitoringRecord;
import kieker.common.record.misc.KiekerMetadataRecord;
......@@ -74,33 +74,27 @@ public class TraceAnalysisConfiguration extends Configuration {
String graphFilesOutputDir = "example/event monitoring log/output"; // TODO Temp hard coded
TraceTraverserStage traceTraverserStage = new TraceTraverserStage();
final Distributor<Graph> graphDistributor = new Distributor<>(new CopyByReferenceStrategy());// TODO use clone
final Distributor<Graph> graphDistributor = new Distributor<>(new CopyByReferenceStrategy());
GraphMLFileWriterStage graphMLFileWriterComposite = new GraphMLFileWriterStage(graphFilesOutputDir);
// DotTraceStyleStage dotTraceStyleStage = new DotTraceStyleStage();
DotFileWriterStage dotFileWriterStage = new DotFileWriterStage(graphFilesOutputDir);
DotTraceGraphFileWriterStage dotTraceGraphFileWriterStage = new DotTraceGraphFileWriterStage(graphFilesOutputDir);
super.connectPorts(distributor.getNewOutputPort(), traceTraverserStage.getInputPort());
super.connectPorts(traceTraverserStage.getOutputPort(), graphDistributor.getInputPort());
super.connectPorts(graphDistributor.getNewOutputPort(), graphMLFileWriterComposite.getInputPort());
super.connectPorts(graphDistributor.getNewOutputPort(), dotFileWriterStage.getInputPort());
// super.connectPorts(graphDistributor.getNewOutputPort(), dotTraceStyleStage.getInputPort());
// super.connectPorts(dotTraceStyleStage.getOutputPort(), dotFileWriterStage.getInputPort());
super.connectPorts(graphDistributor.getNewOutputPort(), dotTraceGraphFileWriterStage.getInputPort());
final Distributor<AggregatedTrace> aggregatedTraceDistributor = new Distributor<>(new CopyByReferenceStrategy());
AggrTraceTraverserStage aggrTraceTraverser = new AggrTraceTraverserStage();
final Distributor<Graph> graphDistributor2 = new Distributor<>(new CopyByReferenceStrategy()); // TODO use clone
final Distributor<Graph> graphDistributor2 = new Distributor<>(new CopyByReferenceStrategy());
GraphMLFileWriterStage graphMLFileWriterComposite2 = new GraphMLFileWriterStage(graphFilesOutputDir);
// DotTraceStyleStage dotAggrTraceStyleStage = new DotTraceStyleStage();
DotFileWriterStage dotFileWriterStage2 = new DotFileWriterStage(graphFilesOutputDir);
DotTraceGraphFileWriterStage dotTraceGraphFileWriterStage2 = new DotTraceGraphFileWriterStage(graphFilesOutputDir);
super.connectPorts(aggregation.getOutputPort(), aggregatedTraceDistributor.getInputPort());
super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), aggrTraceTraverser.getInputPort());
super.connectPorts(aggrTraceTraverser.getOutputPort(), graphDistributor2.getInputPort());
super.connectPorts(graphDistributor2.getNewOutputPort(), graphMLFileWriterComposite2.getInputPort());
super.connectPorts(graphDistributor2.getNewOutputPort(), dotFileWriterStage2.getInputPort());
// super.connectPorts(graphDistributor2.getNewOutputPort(), dotAggrTraceStyleStage.getInputPort());
// super.connectPorts(dotAggrTraceStyleStage.getOutputPort(), dotFileWriterStage2.getInputPort());
super.connectPorts(graphDistributor2.getNewOutputPort(), dotTraceGraphFileWriterStage2.getInputPort());
// DependencyCreatorStage dependencyCreatorStage = new DependencyCreatorStage();
// DependencyStatisticsDecoratorStage dependencyStatisticsDecoratorStage = new DependencyStatisticsDecoratorStage();
......
package kieker.analysis.trace.graphoutput;
import kieker.analysis.util.graph.export.dot.DotFileWriterStage;
import kieker.analysis.util.graph.util.dot.attributes.DotNodeAttribute;
public class DotTraceGraphFileWriterStage extends DotFileWriterStage {
public DotTraceGraphFileWriterStage(final String outputDirectory) {
super(outputDirectory);
exportConfiguration.getDefaultNodeAttributes().put(DotNodeAttribute.SHAPE, (g -> "none"));
}
}
package kieker.analysis.trace.graphoutput;
import kieker.analysis.util.graph.Graph;
import teetime.stage.basic.AbstractTransformation;
public class DotTraceStyleStage extends AbstractTransformation<Graph, Graph> {
// private final Map<String, String> nodeStyling = new HashMap<>();
public DotTraceStyleStage() {
super();
// nodeStyling.put("shape", "none"); // TODO add
}
@Override
protected void execute(final Graph graph) {
// graph.setProperty(DotExportPropertyTokens.DEFAULT_NODE_PROPERTIES, nodeStyling);
this.getOutputPort().send(graph);
}
}
......@@ -9,16 +9,25 @@ import teetime.framework.AbstractConsumerStage;
public class DotWriterStage extends AbstractConsumerStage<Graph> {
private final Function<Graph, Writer> writerMapper;
protected final Function<Graph, Writer> writerMapper;
protected final DotExportConfiguration exportConfiguration;
public DotWriterStage(final Function<Graph, Writer> writerMapper) {
super();
this.writerMapper = writerMapper;
this.exportConfiguration = new SimpleDotExportConfiguration();
}
public DotWriterStage(final Function<Graph, Writer> writerMapper, final DotExportConfiguration exportConfiguration) {
super();
this.writerMapper = writerMapper;
this.exportConfiguration = exportConfiguration;
}
@Override
protected final void execute(final Graph graph) {
DotExporter dotExporter = new DotExporter(graph, writerMapper.apply(graph));
DotExporter dotExporter = new DotExporter(graph, writerMapper.apply(graph), exportConfiguration);
dotExporter.transform();
}
......
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