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

updated DOT styling for deployment dependency graphs

parent ce3b0b0e
No related branches found
No related tags found
1 merge request!19Trace aggr analysis
...@@ -54,9 +54,9 @@ public class DeploymentDependencyGraphCreator { ...@@ -54,9 +54,9 @@ public class DeploymentDependencyGraphCreator {
containerVertex.setProperty("MeanDuration", container.getMeanDuration()); containerVertex.setProperty("MeanDuration", container.getMeanDuration());
containerVertex.setProperty("MedianDuration", container.getMedianDuration()); containerVertex.setProperty("MedianDuration", container.getMedianDuration());
containerVertex.setProperty("TotalDuration", container.getTotalDuration()); containerVertex.setProperty("TotalDuration", container.getTotalDuration());
Graph componentGraph = containerVertex.addChildGraph();
if (this.depth.compareTo(DeploymentDependencyGraphLevel.COMPONENT) <= 0) { if (this.depth.compareTo(DeploymentDependencyGraphLevel.COMPONENT) <= 0) {
Graph componentGraph = containerVertex.addChildGraph();
for (Component component : container.getComponents()) { for (Component component : container.getComponents()) {
...@@ -68,9 +68,9 @@ public class DeploymentDependencyGraphCreator { ...@@ -68,9 +68,9 @@ public class DeploymentDependencyGraphCreator {
componentVertex.setProperty("MeanDuration", component.getMeanDuration()); componentVertex.setProperty("MeanDuration", component.getMeanDuration());
componentVertex.setProperty("MedianDuration", component.getMedianDuration()); componentVertex.setProperty("MedianDuration", component.getMedianDuration());
componentVertex.setProperty("TotalDuration", component.getTotalDuration()); componentVertex.setProperty("TotalDuration", component.getTotalDuration());
Graph operationsGraph = componentVertex.addChildGraph();
if (this.depth.compareTo(DeploymentDependencyGraphLevel.OPERATION) <= 0) { if (this.depth.compareTo(DeploymentDependencyGraphLevel.OPERATION) <= 0) {
Graph operationsGraph = componentVertex.addChildGraph();
for (Operation operation : component.getOperations()) { for (Operation operation : component.getOperations()) {
Vertex operationVertex = operationsGraph.addVertex(operation.getIdentifier()); Vertex operationVertex = operationsGraph.addVertex(operation.getIdentifier());
......
...@@ -14,9 +14,9 @@ public class DotComponentsDependencyExportStage extends DotFileWriterStage { ...@@ -14,9 +14,9 @@ public class DotComponentsDependencyExportStage extends DotFileWriterStage {
public DotComponentsDependencyExportStage(final String outputDirectory) { public DotComponentsDependencyExportStage(final String outputDirectory) {
super(outputDirectory); super(outputDirectory);
this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR"); this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR");
this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "oval"); this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "box");
this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper()); this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper());
this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new OperationVertexMapper()); this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new ComponentVertexMapper());
this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString())); this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString()));
// Styling // Styling
// Something like this would be cool: // Something like this would be cool:
...@@ -25,12 +25,13 @@ public class DotComponentsDependencyExportStage extends DotFileWriterStage { ...@@ -25,12 +25,13 @@ public class DotComponentsDependencyExportStage extends DotFileWriterStage {
// TODO Consider if nested class is useful // TODO Consider if nested class is useful
private class OperationVertexMapper implements Function<Vertex, String> { private class ComponentVertexMapper implements Function<Vertex, String> {
@Override @Override
public String apply(final Vertex vertex) { public String apply(final Vertex vertex) {
// TODO missing temporal unit // TODO missing temporal unit
final StringBuilder statistics = new StringBuilder(); final StringBuilder statistics = new StringBuilder();
statistics.append("<<deployment component>>\\n");
statistics.append(vertex.getProperty("Name").toString()); statistics.append(vertex.getProperty("Name").toString());
statistics.append("\\n min: "); statistics.append("\\n min: ");
statistics.append(vertex.getProperty("MinDuration").toString()); statistics.append(vertex.getProperty("MinDuration").toString());
......
...@@ -14,9 +14,9 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage { ...@@ -14,9 +14,9 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage {
public DotContainersDependencyExportStage(final String outputDirectory) { public DotContainersDependencyExportStage(final String outputDirectory) {
super(outputDirectory); super(outputDirectory);
this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR"); this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR");
this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "oval"); this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "box3d");
this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper()); this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper());
this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new OperationVertexMapper()); this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new ContainerVertexMapper());
this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString())); this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString()));
// Styling // Styling
// Something like this would be cool: // Something like this would be cool:
...@@ -25,12 +25,13 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage { ...@@ -25,12 +25,13 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage {
// TODO Consider if nested class is useful // TODO Consider if nested class is useful
private class OperationVertexMapper implements Function<Vertex, String> { private class ContainerVertexMapper implements Function<Vertex, String> {
@Override @Override
public String apply(final Vertex vertex) { public String apply(final Vertex vertex) {
// TODO missing temporal unit // TODO missing temporal unit
final StringBuilder statistics = new StringBuilder(); final StringBuilder statistics = new StringBuilder();
statistics.append("<<execution container>>\\n");
statistics.append(vertex.getProperty("Name").toString()); statistics.append(vertex.getProperty("Name").toString());
statistics.append("\\n min: "); statistics.append("\\n min: ");
statistics.append(vertex.getProperty("MinDuration").toString()); statistics.append(vertex.getProperty("MinDuration").toString());
...@@ -48,6 +49,7 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage { ...@@ -48,6 +49,7 @@ public class DotContainersDependencyExportStage extends DotFileWriterStage {
} }
// Not used in this class
private class ClusterMapper implements Function<Vertex, String> { private class ClusterMapper implements Function<Vertex, String> {
@Override @Override
......
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