diff --git a/src/main/java/kieker/analysis/dev/ComponentDependencyGraphCreatorStage.java b/src/main/java/kieker/analysis/dev/ComponentDependencyGraphCreatorStage.java index c347c84e42d7bfc7e57cdbf4bf5260861bc67044..0191c8e1e186eec9e3d865553d31b758e4457150 100644 --- a/src/main/java/kieker/analysis/dev/ComponentDependencyGraphCreatorStage.java +++ b/src/main/java/kieker/analysis/dev/ComponentDependencyGraphCreatorStage.java @@ -9,7 +9,7 @@ import teetime.stage.basic.AbstractTransformation; public class ComponentDependencyGraphCreatorStage extends AbstractTransformation<OperationsDependency, Graph> { @Override - protected void execute(final OperationsDependency element) { + protected void execute(final OperationsDependency operationsDependency) { // Loop trough nodes // Loop trough edges diff --git a/src/main/java/kieker/analysis/domain/ComponentCall.java b/src/main/java/kieker/analysis/domain/ComponentCall.java new file mode 100644 index 0000000000000000000000000000000000000000..a4f700684c918810b4a84c0151329b580c511643 --- /dev/null +++ b/src/main/java/kieker/analysis/domain/ComponentCall.java @@ -0,0 +1,33 @@ +package kieker.analysis.domain; + +public class ComponentCall { + + private final String container; + private final String component; + + private final String identifier; + + public ComponentCall(final String container, final String component) { + this.container = container; + this.component = component; + + this.identifier = container + ',' + component; + } + + public ComponentCall(final AbstractOperationCall<?> operationCall) { + this(operationCall.getContainer(), operationCall.getComponent()); + } + + public String getContainer() { + return container; + } + + public String getComponent() { + return component; + } + + public String getIdentifier() { + return identifier; + } + +} diff --git a/src/main/java/kieker/analysis/domain/ComponentDependency.java b/src/main/java/kieker/analysis/domain/ComponentDependency.java new file mode 100644 index 0000000000000000000000000000000000000000..fc51d2f1f3a1da2a9ce10613ac479cff9d55620a --- /dev/null +++ b/src/main/java/kieker/analysis/domain/ComponentDependency.java @@ -0,0 +1,45 @@ +package kieker.analysis.domain; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +public class ComponentDependency { + + private final Map<String, ComponentCall> components = new HashMap<>(); + + private final Map<String, ComponentDependencyRelation> relations = new HashMap<>(); + + // TODO this should not be part of the model + public void addCall(final AggregatedOperationCall operationCall) { + + ComponentCall componentCall = new ComponentCall(operationCall); + + if (!components.containsKey(componentCall.getIdentifier())) { + components.put(componentCall.getIdentifier(), componentCall); + } + + } + + public void addRelation(final OperationsDependencyRelation relation) { + + String id1 = new ComponentCall(relation.getCaller()).getIdentifier(); + String id2 = new ComponentCall(relation.getCallee()).getIdentifier(); + + String id = id1 + ',' + id2; + + if (!relations.containsKey(id)) { + // components.put(id, new ComponentDependencyRelation(caller, callee) + } + + } + + public Collection<ComponentCall> getComponents() { + return components.values(); + } + + public Collection<ComponentDependencyRelation> getRelations() { + return relations.values(); + } + +} diff --git a/src/main/java/kieker/analysis/domain/ComponentDependencyRelation.java b/src/main/java/kieker/analysis/domain/ComponentDependencyRelation.java new file mode 100644 index 0000000000000000000000000000000000000000..17d147421eb3c528b67d8e3592177dc6f143efb8 --- /dev/null +++ b/src/main/java/kieker/analysis/domain/ComponentDependencyRelation.java @@ -0,0 +1,43 @@ +package kieker.analysis.domain; + +public class ComponentDependencyRelation { + + private final ComponentCall caller; + + private final ComponentCall callee; + + private int calls; + + private int failuredCalls; + + public ComponentDependencyRelation(final ComponentCall caller, final ComponentCall callee) { + this.caller = caller; + this.callee = callee; + } + + public ComponentCall getCaller() { + return caller; + } + + public ComponentCall getCallee() { + return callee; + } + + public void addCalls(final int calls) { + this.calls += calls; + } + + public void addFailuredCalls(final int failuredCalls) { + addCalls(failuredCalls); + this.failuredCalls += failuredCalls; + } + + public int getCalls() { + return calls; + } + + public int getFailuredCalls() { + return failuredCalls; + } + +} diff --git a/src/main/java/kieker/analysis/domain/OperationsDependency.java b/src/main/java/kieker/analysis/domain/OperationsDependency.java index 19ff626152de550beac71e94460cadcabd1ad978..41fd8758e706c69df599450e741a646d507e3e76 100644 --- a/src/main/java/kieker/analysis/domain/OperationsDependency.java +++ b/src/main/java/kieker/analysis/domain/OperationsDependency.java @@ -27,6 +27,7 @@ public class OperationsDependency { addRelation(call); } + // TODO this should not be part of the model private void addOperation(final AggregatedOperationCall call) { String key = call.getIdentifier();