diff --git a/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java b/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java index 44ab521e73096d00ada8c847b69265a29a9550e0..f34d1c5575c5c89edc4ce432c2e29f0e00c24f9d 100644 --- a/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java +++ b/src/main/java/kieker/analysis/TraceAnalysisConfiguration.java @@ -7,7 +7,10 @@ import java.io.File; import kieker.analysis.dev.ComponentStatisticsDecoratorStage; import kieker.analysis.dev.OperationsStatisticsDecoratorStage; +import kieker.analysis.dev.SoftwareSystemAggregatorStage; 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.DeploymentDependencyGraphLevel; import kieker.analysis.dev.dependencygraphs.DotComponentsDependencyExportStage; @@ -97,6 +100,8 @@ public class TraceAnalysisConfiguration extends Configuration { // super.connectPorts(graphDistributor2.getNewOutputPort(), dotTraceGraphFileWriterStage2.getInputPort()); SoftwareSystemCreatorStage softwareSystemCreator = new SoftwareSystemCreatorStage(); + Distributor<SoftwareSystem> softwareSystemDistributor = new Distributor<>(new CopyByReferenceStrategy()); + OperationsStatisticsDecoratorStage operationsStatisticsDecorator = new OperationsStatisticsDecoratorStage(); Distributor<SoftwareSystem> x1SoftwareSystemDistributor = new Distributor<>(new CopyByReferenceStrategy()); // TODO name required ComponentStatisticsDecoratorStage componentsStatisticsDecorator = new ComponentStatisticsDecoratorStage(); @@ -109,8 +114,20 @@ public class TraceAnalysisConfiguration extends Configuration { DeploymentDependencyGraphCreatorStage containerDependencyGraphCreator = new DeploymentDependencyGraphCreatorStage(DeploymentDependencyGraphLevel.CONTAINER); 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(softwareSystemCreator.getOutputPort(), operationsStatisticsDecorator.getInputPort()); + super.connectPorts(softwareSystemCreator.getOutputPort(), softwareSystemDistributor.getInputPort()); + + super.connectPorts(softwareSystemDistributor.getNewOutputPort(), operationsStatisticsDecorator.getInputPort()); super.connectPorts(operationsStatisticsDecorator.getOutputPort(), x1SoftwareSystemDistributor.getInputPort()); super.connectPorts(x1SoftwareSystemDistributor.getNewOutputPort(), operationsDependencyGraphCreator.getInputPort()); super.connectPorts(operationsDependencyGraphCreator.getOutputPort(), dotOperationsDependencyExporter.getInputPort()); @@ -122,6 +139,17 @@ public class TraceAnalysisConfiguration extends Configuration { super.connectPorts(x2SoftwareSystemDistributor.getNewOutputPort(), containerDependencyGraphCreator.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()); + /* * * diff --git a/src/main/java/kieker/analysis/dev/SoftwareSystemAggregatorStage.java b/src/main/java/kieker/analysis/dev/SoftwareSystemAggregatorStage.java index 6baa77f98cc74985bdfa778454c7397bce82aa5a..3e85a7215a4c085b339e0279d25d2947b95c98e9 100644 --- a/src/main/java/kieker/analysis/dev/SoftwareSystemAggregatorStage.java +++ b/src/main/java/kieker/analysis/dev/SoftwareSystemAggregatorStage.java @@ -1,12 +1,5 @@ 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 teetime.stage.basic.AbstractTransformation; @@ -19,45 +12,50 @@ public class SoftwareSystemAggregatorStage extends AbstractTransformation<Softwa @Override protected void execute(final SoftwareSystem deploymentSoftwareSystem) { - Map<Component, Component> components = new HashMap<>(); // Old -> New - Map<Operation, Operation> operations = new HashMap<>(); // Old -> New - - SoftwareSystem assemblySoftwareSystem = new SoftwareSystem(); - Container newContainer = assemblySoftwareSystem.addContainer("DEFAULT"); - - for (Container container : deploymentSoftwareSystem.getContainers()) { - for (Component component : container.getComponents()) { - Component newComponent = newContainer.addComponent(component.getName()); - 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 - Dependency<Component> dependency = assemblySoftwareSystem.addComponentDependency(newCaller, newCallee); - dependency.addCalls(componentDependency.getCalls()); - dependency.addFailuredCalls(componentDependency.getFailuredCalls()); - } - - for (Dependency<Operation> operationDependency : deploymentSoftwareSystem.getOperationDependencies()) { - Operation newCaller = operations.get(operationDependency.getCaller()); - Operation newCallee = operations.get(operationDependency.getCallee()); - - // Adds only if absent - Dependency<Operation> dependency = assemblySoftwareSystem.addOperationDependency(newCaller, newCallee); - dependency.addCalls(operationDependency.getCalls()); - dependency.addFailuredCalls(operationDependency.getFailuredCalls()); - } - - this.outputPort.send(assemblySoftwareSystem); + this.getOutputPort().send(deploymentSoftwareSystem); // TODO temp + + /* + * + * Map<Component, Component> components = new HashMap<>(); // Old -> New + * Map<Operation, Operation> operations = new HashMap<>(); // Old -> New + * + * SoftwareSystem assemblySoftwareSystem = new SoftwareSystem(); + * Container newContainer = assemblySoftwareSystem.addContainer("DEFAULT"); + * + * for (Container container : deploymentSoftwareSystem.getContainers()) { + * for (Component component : container.getComponents()) { + * Component newComponent = newContainer.addComponent(component.getName()); + * 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 + * Dependency<Component> dependency = assemblySoftwareSystem.addComponentDependency(newCaller, newCallee); + * dependency.addCalls(componentDependency.getCalls()); + * dependency.addFailuredCalls(componentDependency.getFailuredCalls()); + * } + * + * for (Dependency<Operation> operationDependency : deploymentSoftwareSystem.getOperationDependencies()) { + * Operation newCaller = operations.get(operationDependency.getCaller()); + * Operation newCallee = operations.get(operationDependency.getCallee()); + * + * // Adds only if absent + * Dependency<Operation> dependency = assemblySoftwareSystem.addOperationDependency(newCaller, newCallee); + * dependency.addCalls(operationDependency.getCalls()); + * dependency.addFailuredCalls(operationDependency.getFailuredCalls()); + * } + * + * this.getOutputPort().send(assemblySoftwareSystem); + */ } } diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/AssemblyDependencyGraphCreator.java b/src/main/java/kieker/analysis/dev/dependencygraphs/AssemblyDependencyGraphCreator.java index 89863f20a3d12b9a06cac962285346f0926ed2d6..e6d0f02db89df026ad452c335d03e7fce040162a 100644 --- a/src/main/java/kieker/analysis/dev/dependencygraphs/AssemblyDependencyGraphCreator.java +++ b/src/main/java/kieker/analysis/dev/dependencygraphs/AssemblyDependencyGraphCreator.java @@ -34,10 +34,10 @@ public class AssemblyDependencyGraphCreator { Graph graph = new GraphImpl(); switch (this.depth) { case COMPONENT: - graph.setName("DeploymentComponentsDependencyGraph"); + graph.setName("AssemblyComponentsDependencyGraph"); break; case OPERATION: - graph.setName("DeploymentOperationsDependencyGraph"); + graph.setName("AssemblyOperationsDependencyGraph"); break; } @@ -81,14 +81,11 @@ public class AssemblyDependencyGraphCreator { if (this.relations.contains(AssemblyDependencyGraphLevel.COMPONENT)) { for (Dependency<Component> dependency : softwareSystem.getComponentDependencies()) { - String callerContainerIdentifier = dependency.getCaller().getContainer().getIdentifier(); String callerComponentIdentifier = dependency.getCaller().getIdentifier(); - - String calleeContainerIdentifier = dependency.getCallee().getContainer().getIdentifier(); String calleeComponentIdentifier = dependency.getCallee().getIdentifier(); - Vertex callerVertex = graph.getVertex(callerContainerIdentifier).getChildGraph().getVertex(callerComponentIdentifier); - Vertex calleeVertex = graph.getVertex(calleeContainerIdentifier).getChildGraph().getVertex(calleeComponentIdentifier); + Vertex callerVertex = graph.getVertex(callerComponentIdentifier); + Vertex calleeVertex = graph.getVertex(calleeComponentIdentifier); Edge dependencyEdge = graph.addEdge(null, callerVertex, calleeVertex); dependencyEdge.setProperty("calls", dependency.getCalls()); @@ -99,18 +96,14 @@ public class AssemblyDependencyGraphCreator { if (this.relations.contains(AssemblyDependencyGraphLevel.OPERATION)) { for (Dependency<Operation> dependency : softwareSystem.getOperationDependencies()) { - String callerContainerIdentifier = dependency.getCaller().getComponent().getContainer().getIdentifier(); String callerComponentIdentifier = dependency.getCaller().getComponent().getIdentifier(); String callerOperationIdentifier = dependency.getCaller().getIdentifier(); - String calleeContainerIdentifier = dependency.getCallee().getComponent().getContainer().getIdentifier(); String calleeComponentIdentifier = dependency.getCallee().getComponent().getIdentifier(); String calleeOperationIdentifier = dependency.getCallee().getIdentifier(); - Vertex callerVertex = graph.getVertex(callerContainerIdentifier).getChildGraph().getVertex(callerComponentIdentifier).getChildGraph() - .getVertex(callerOperationIdentifier); - Vertex calleeVertex = graph.getVertex(calleeContainerIdentifier).getChildGraph().getVertex(calleeComponentIdentifier).getChildGraph() - .getVertex(calleeOperationIdentifier); + Vertex callerVertex = graph.getVertex(callerComponentIdentifier).getChildGraph().getVertex(callerOperationIdentifier); + Vertex calleeVertex = graph.getVertex(calleeComponentIdentifier).getChildGraph().getVertex(calleeOperationIdentifier); Edge dependencyEdge = graph.addEdge(null, callerVertex, calleeVertex); dependencyEdge.setProperty("calls", dependency.getCalls());