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

work on #19

parent 26719cbc
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
...@@ -9,7 +9,7 @@ import teetime.stage.basic.AbstractTransformation; ...@@ -9,7 +9,7 @@ import teetime.stage.basic.AbstractTransformation;
public class ComponentDependencyGraphCreatorStage extends AbstractTransformation<OperationsDependency, Graph> { public class ComponentDependencyGraphCreatorStage extends AbstractTransformation<OperationsDependency, Graph> {
@Override @Override
protected void execute(final OperationsDependency element) { protected void execute(final OperationsDependency operationsDependency) {
// Loop trough nodes // Loop trough nodes
// Loop trough edges // Loop trough edges
......
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;
}
}
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();
}
}
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;
}
}
...@@ -27,6 +27,7 @@ public class OperationsDependency { ...@@ -27,6 +27,7 @@ public class OperationsDependency {
addRelation(call); addRelation(call);
} }
// TODO this should not be part of the model
private void addOperation(final AggregatedOperationCall call) { private void addOperation(final AggregatedOperationCall call) {
String key = call.getIdentifier(); String key = call.getIdentifier();
......
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