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

bug fixes

parent 20c24bb7
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,10 @@ import java.io.File; ...@@ -7,7 +7,10 @@ import java.io.File;
import kieker.analysis.dev.ComponentStatisticsDecoratorStage; import kieker.analysis.dev.ComponentStatisticsDecoratorStage;
import kieker.analysis.dev.OperationsStatisticsDecoratorStage; import kieker.analysis.dev.OperationsStatisticsDecoratorStage;
import kieker.analysis.dev.SoftwareSystemAggregatorStage;
import kieker.analysis.dev.SoftwareSystemCreatorStage; import kieker.analysis.dev.SoftwareSystemCreatorStage;
import kieker.analysis.dev.dependencygraphs.AssemblyDependencyGraphCreatorStage;
import kieker.analysis.dev.dependencygraphs.AssemblyDependencyGraphLevel;
import kieker.analysis.dev.dependencygraphs.DeploymentDependencyGraphCreatorStage; import kieker.analysis.dev.dependencygraphs.DeploymentDependencyGraphCreatorStage;
import kieker.analysis.dev.dependencygraphs.DeploymentDependencyGraphLevel; import kieker.analysis.dev.dependencygraphs.DeploymentDependencyGraphLevel;
import kieker.analysis.dev.dependencygraphs.DotComponentsDependencyExportStage; import kieker.analysis.dev.dependencygraphs.DotComponentsDependencyExportStage;
...@@ -97,6 +100,8 @@ public class TraceAnalysisConfiguration extends Configuration { ...@@ -97,6 +100,8 @@ public class TraceAnalysisConfiguration extends Configuration {
// super.connectPorts(graphDistributor2.getNewOutputPort(), dotTraceGraphFileWriterStage2.getInputPort()); // super.connectPorts(graphDistributor2.getNewOutputPort(), dotTraceGraphFileWriterStage2.getInputPort());
SoftwareSystemCreatorStage softwareSystemCreator = new SoftwareSystemCreatorStage(); SoftwareSystemCreatorStage softwareSystemCreator = new SoftwareSystemCreatorStage();
Distributor<SoftwareSystem> softwareSystemDistributor = new Distributor<>(new CopyByReferenceStrategy());
OperationsStatisticsDecoratorStage operationsStatisticsDecorator = new OperationsStatisticsDecoratorStage(); OperationsStatisticsDecoratorStage operationsStatisticsDecorator = new OperationsStatisticsDecoratorStage();
Distributor<SoftwareSystem> x1SoftwareSystemDistributor = new Distributor<>(new CopyByReferenceStrategy()); // TODO name required Distributor<SoftwareSystem> x1SoftwareSystemDistributor = new Distributor<>(new CopyByReferenceStrategy()); // TODO name required
ComponentStatisticsDecoratorStage componentsStatisticsDecorator = new ComponentStatisticsDecoratorStage(); ComponentStatisticsDecoratorStage componentsStatisticsDecorator = new ComponentStatisticsDecoratorStage();
...@@ -109,8 +114,20 @@ public class TraceAnalysisConfiguration extends Configuration { ...@@ -109,8 +114,20 @@ public class TraceAnalysisConfiguration extends Configuration {
DeploymentDependencyGraphCreatorStage containerDependencyGraphCreator = new DeploymentDependencyGraphCreatorStage(DeploymentDependencyGraphLevel.CONTAINER); DeploymentDependencyGraphCreatorStage containerDependencyGraphCreator = new DeploymentDependencyGraphCreatorStage(DeploymentDependencyGraphLevel.CONTAINER);
DotContainersDependencyExportStage dotContainerDependencyExporter = new DotContainersDependencyExportStage(graphFilesOutputDir); DotContainersDependencyExportStage dotContainerDependencyExporter = new DotContainersDependencyExportStage(graphFilesOutputDir);
SoftwareSystemAggregatorStage softwareSystemAggregator = new SoftwareSystemAggregatorStage();
OperationsStatisticsDecoratorStage operationsStatisticsDecoratorAss = new OperationsStatisticsDecoratorStage();
Distributor<SoftwareSystem> x1SoftwareSystemDistributorAss = new Distributor<>(new CopyByReferenceStrategy()); // TODO name required
ComponentStatisticsDecoratorStage componentsStatisticsDecoratorAss = new ComponentStatisticsDecoratorStage();
Distributor<SoftwareSystem> x2SoftwareSystemDistributorAss = new Distributor<>(new CopyByReferenceStrategy()); // TODO name required
AssemblyDependencyGraphCreatorStage operationsDependencyGraphCreatorAss = new AssemblyDependencyGraphCreatorStage(AssemblyDependencyGraphLevel.OPERATION);
DotOperationsDependencyExportStage dotOperationsDependencyExporterAss = new DotOperationsDependencyExportStage(graphFilesOutputDir);
AssemblyDependencyGraphCreatorStage componentDependencyGraphCreatorAss = new AssemblyDependencyGraphCreatorStage(AssemblyDependencyGraphLevel.COMPONENT);
DotComponentsDependencyExportStage dotComponentDependencyExporterAss = new DotComponentsDependencyExportStage(graphFilesOutputDir);
super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), softwareSystemCreator.getInputPort()); super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), softwareSystemCreator.getInputPort());
super.connectPorts(softwareSystemCreator.getOutputPort(), operationsStatisticsDecorator.getInputPort()); super.connectPorts(softwareSystemCreator.getOutputPort(), softwareSystemDistributor.getInputPort());
super.connectPorts(softwareSystemDistributor.getNewOutputPort(), operationsStatisticsDecorator.getInputPort());
super.connectPorts(operationsStatisticsDecorator.getOutputPort(), x1SoftwareSystemDistributor.getInputPort()); super.connectPorts(operationsStatisticsDecorator.getOutputPort(), x1SoftwareSystemDistributor.getInputPort());
super.connectPorts(x1SoftwareSystemDistributor.getNewOutputPort(), operationsDependencyGraphCreator.getInputPort()); super.connectPorts(x1SoftwareSystemDistributor.getNewOutputPort(), operationsDependencyGraphCreator.getInputPort());
super.connectPorts(operationsDependencyGraphCreator.getOutputPort(), dotOperationsDependencyExporter.getInputPort()); super.connectPorts(operationsDependencyGraphCreator.getOutputPort(), dotOperationsDependencyExporter.getInputPort());
...@@ -122,6 +139,17 @@ public class TraceAnalysisConfiguration extends Configuration { ...@@ -122,6 +139,17 @@ public class TraceAnalysisConfiguration extends Configuration {
super.connectPorts(x2SoftwareSystemDistributor.getNewOutputPort(), containerDependencyGraphCreator.getInputPort()); super.connectPorts(x2SoftwareSystemDistributor.getNewOutputPort(), containerDependencyGraphCreator.getInputPort());
super.connectPorts(containerDependencyGraphCreator.getOutputPort(), dotContainerDependencyExporter.getInputPort()); super.connectPorts(containerDependencyGraphCreator.getOutputPort(), dotContainerDependencyExporter.getInputPort());
super.connectPorts(softwareSystemDistributor.getNewOutputPort(), softwareSystemAggregator.getInputPort());
super.connectPorts(softwareSystemAggregator.getOutputPort(), operationsStatisticsDecoratorAss.getInputPort());
super.connectPorts(operationsStatisticsDecoratorAss.getOutputPort(), x1SoftwareSystemDistributorAss.getInputPort());
super.connectPorts(x1SoftwareSystemDistributorAss.getNewOutputPort(), operationsDependencyGraphCreatorAss.getInputPort());
super.connectPorts(operationsDependencyGraphCreatorAss.getOutputPort(), dotOperationsDependencyExporterAss.getInputPort());
// super.connectPorts(x1SoftwareSystemDistributorAss.getNewOutputPort(), componentsStatisticsDecoratorAss.getInputPort());
// super.connectPorts(componentsStatisticsDecoratorAss.getOutputPort(), x2SoftwareSystemDistributorAss.getInputPort());
super.connectPorts(x1SoftwareSystemDistributorAss.getNewOutputPort(), x2SoftwareSystemDistributorAss.getInputPort());
super.connectPorts(x2SoftwareSystemDistributorAss.getNewOutputPort(), componentDependencyGraphCreatorAss.getInputPort());
super.connectPorts(componentDependencyGraphCreatorAss.getOutputPort(), dotComponentDependencyExporterAss.getInputPort());
/* /*
* *
* *
......
package kieker.analysis.dev; package kieker.analysis.dev;
import java.util.HashMap;
import java.util.Map;
import kieker.analysis.domain.systemdependency.Component;
import kieker.analysis.domain.systemdependency.Container;
import kieker.analysis.domain.systemdependency.Dependency;
import kieker.analysis.domain.systemdependency.Operation;
import kieker.analysis.domain.systemdependency.SoftwareSystem; import kieker.analysis.domain.systemdependency.SoftwareSystem;
import teetime.stage.basic.AbstractTransformation; import teetime.stage.basic.AbstractTransformation;
...@@ -19,45 +12,50 @@ public class SoftwareSystemAggregatorStage extends AbstractTransformation<Softwa ...@@ -19,45 +12,50 @@ public class SoftwareSystemAggregatorStage extends AbstractTransformation<Softwa
@Override @Override
protected void execute(final SoftwareSystem deploymentSoftwareSystem) { protected void execute(final SoftwareSystem deploymentSoftwareSystem) {
Map<Component, Component> components = new HashMap<>(); // Old -> New this.getOutputPort().send(deploymentSoftwareSystem); // TODO temp
Map<Operation, Operation> operations = new HashMap<>(); // Old -> New
/*
SoftwareSystem assemblySoftwareSystem = new SoftwareSystem(); *
Container newContainer = assemblySoftwareSystem.addContainer("DEFAULT"); * Map<Component, Component> components = new HashMap<>(); // Old -> New
* Map<Operation, Operation> operations = new HashMap<>(); // Old -> New
for (Container container : deploymentSoftwareSystem.getContainers()) { *
for (Component component : container.getComponents()) { * SoftwareSystem assemblySoftwareSystem = new SoftwareSystem();
Component newComponent = newContainer.addComponent(component.getName()); * Container newContainer = assemblySoftwareSystem.addContainer("DEFAULT");
components.put(component, newComponent); *
for (Operation operation : component.getOperations()) { * for (Container container : deploymentSoftwareSystem.getContainers()) {
Operation newOperation = newComponent.addOperation(operation.getName()); * for (Component component : container.getComponents()) {
newOperation.getOperationCalls().addAll(operation.getOperationCalls()); * Component newComponent = newContainer.addComponent(component.getName());
operations.put(operation, newOperation); * components.put(component, newComponent);
} * for (Operation operation : component.getOperations()) {
} * Operation newOperation = newComponent.addOperation(operation.getName());
} * newOperation.getOperationCalls().addAll(operation.getOperationCalls());
* operations.put(operation, newOperation);
for (Dependency<Component> componentDependency : deploymentSoftwareSystem.getComponentDependencies()) { * }
Component newCaller = components.get(componentDependency.getCaller()); * }
Component newCallee = components.get(componentDependency.getCallee()); * }
*
// Adds only if absent * for (Dependency<Component> componentDependency : deploymentSoftwareSystem.getComponentDependencies()) {
Dependency<Component> dependency = assemblySoftwareSystem.addComponentDependency(newCaller, newCallee); * Component newCaller = components.get(componentDependency.getCaller());
dependency.addCalls(componentDependency.getCalls()); * Component newCallee = components.get(componentDependency.getCallee());
dependency.addFailuredCalls(componentDependency.getFailuredCalls()); *
} * // Adds only if absent
* Dependency<Component> dependency = assemblySoftwareSystem.addComponentDependency(newCaller, newCallee);
for (Dependency<Operation> operationDependency : deploymentSoftwareSystem.getOperationDependencies()) { * dependency.addCalls(componentDependency.getCalls());
Operation newCaller = operations.get(operationDependency.getCaller()); * dependency.addFailuredCalls(componentDependency.getFailuredCalls());
Operation newCallee = operations.get(operationDependency.getCallee()); * }
*
// Adds only if absent * for (Dependency<Operation> operationDependency : deploymentSoftwareSystem.getOperationDependencies()) {
Dependency<Operation> dependency = assemblySoftwareSystem.addOperationDependency(newCaller, newCallee); * Operation newCaller = operations.get(operationDependency.getCaller());
dependency.addCalls(operationDependency.getCalls()); * Operation newCallee = operations.get(operationDependency.getCallee());
dependency.addFailuredCalls(operationDependency.getFailuredCalls()); *
} * // Adds only if absent
* Dependency<Operation> dependency = assemblySoftwareSystem.addOperationDependency(newCaller, newCallee);
this.outputPort.send(assemblySoftwareSystem); * dependency.addCalls(operationDependency.getCalls());
* dependency.addFailuredCalls(operationDependency.getFailuredCalls());
* }
*
* this.getOutputPort().send(assemblySoftwareSystem);
*/
} }
} }
...@@ -34,10 +34,10 @@ public class AssemblyDependencyGraphCreator { ...@@ -34,10 +34,10 @@ public class AssemblyDependencyGraphCreator {
Graph graph = new GraphImpl(); Graph graph = new GraphImpl();
switch (this.depth) { switch (this.depth) {
case COMPONENT: case COMPONENT:
graph.setName("DeploymentComponentsDependencyGraph"); graph.setName("AssemblyComponentsDependencyGraph");
break; break;
case OPERATION: case OPERATION:
graph.setName("DeploymentOperationsDependencyGraph"); graph.setName("AssemblyOperationsDependencyGraph");
break; break;
} }
...@@ -81,14 +81,11 @@ public class AssemblyDependencyGraphCreator { ...@@ -81,14 +81,11 @@ public class AssemblyDependencyGraphCreator {
if (this.relations.contains(AssemblyDependencyGraphLevel.COMPONENT)) { if (this.relations.contains(AssemblyDependencyGraphLevel.COMPONENT)) {
for (Dependency<Component> dependency : softwareSystem.getComponentDependencies()) { for (Dependency<Component> dependency : softwareSystem.getComponentDependencies()) {
String callerContainerIdentifier = dependency.getCaller().getContainer().getIdentifier();
String callerComponentIdentifier = dependency.getCaller().getIdentifier(); String callerComponentIdentifier = dependency.getCaller().getIdentifier();
String calleeContainerIdentifier = dependency.getCallee().getContainer().getIdentifier();
String calleeComponentIdentifier = dependency.getCallee().getIdentifier(); String calleeComponentIdentifier = dependency.getCallee().getIdentifier();
Vertex callerVertex = graph.getVertex(callerContainerIdentifier).getChildGraph().getVertex(callerComponentIdentifier); Vertex callerVertex = graph.getVertex(callerComponentIdentifier);
Vertex calleeVertex = graph.getVertex(calleeContainerIdentifier).getChildGraph().getVertex(calleeComponentIdentifier); Vertex calleeVertex = graph.getVertex(calleeComponentIdentifier);
Edge dependencyEdge = graph.addEdge(null, callerVertex, calleeVertex); Edge dependencyEdge = graph.addEdge(null, callerVertex, calleeVertex);
dependencyEdge.setProperty("calls", dependency.getCalls()); dependencyEdge.setProperty("calls", dependency.getCalls());
...@@ -99,18 +96,14 @@ public class AssemblyDependencyGraphCreator { ...@@ -99,18 +96,14 @@ public class AssemblyDependencyGraphCreator {
if (this.relations.contains(AssemblyDependencyGraphLevel.OPERATION)) { if (this.relations.contains(AssemblyDependencyGraphLevel.OPERATION)) {
for (Dependency<Operation> dependency : softwareSystem.getOperationDependencies()) { for (Dependency<Operation> dependency : softwareSystem.getOperationDependencies()) {
String callerContainerIdentifier = dependency.getCaller().getComponent().getContainer().getIdentifier();
String callerComponentIdentifier = dependency.getCaller().getComponent().getIdentifier(); String callerComponentIdentifier = dependency.getCaller().getComponent().getIdentifier();
String callerOperationIdentifier = dependency.getCaller().getIdentifier(); String callerOperationIdentifier = dependency.getCaller().getIdentifier();
String calleeContainerIdentifier = dependency.getCallee().getComponent().getContainer().getIdentifier();
String calleeComponentIdentifier = dependency.getCallee().getComponent().getIdentifier(); String calleeComponentIdentifier = dependency.getCallee().getComponent().getIdentifier();
String calleeOperationIdentifier = dependency.getCallee().getIdentifier(); String calleeOperationIdentifier = dependency.getCallee().getIdentifier();
Vertex callerVertex = graph.getVertex(callerContainerIdentifier).getChildGraph().getVertex(callerComponentIdentifier).getChildGraph() Vertex callerVertex = graph.getVertex(callerComponentIdentifier).getChildGraph().getVertex(callerOperationIdentifier);
.getVertex(callerOperationIdentifier); Vertex calleeVertex = graph.getVertex(calleeComponentIdentifier).getChildGraph().getVertex(calleeOperationIdentifier);
Vertex calleeVertex = graph.getVertex(calleeContainerIdentifier).getChildGraph().getVertex(calleeComponentIdentifier).getChildGraph()
.getVertex(calleeOperationIdentifier);
Edge dependencyEdge = graph.addEdge(null, callerVertex, calleeVertex); Edge dependencyEdge = graph.addEdge(null, callerVertex, calleeVertex);
dependencyEdge.setProperty("calls", dependency.getCalls()); dependencyEdge.setProperty("calls", dependency.getCalls());
......
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