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

Add statistics to operations in dependency model

parent 6d3bd1b9
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
...@@ -10,6 +10,7 @@ import java.util.List; ...@@ -10,6 +10,7 @@ import java.util.List;
import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Graph;
import kieker.analysis.dev.DependencyCreatorStage; import kieker.analysis.dev.DependencyCreatorStage;
import kieker.analysis.dev.DependencyStatisticsDecoratorStage;
import kieker.analysis.stage.tracediagnosis.AllowedRecordsFilter; import kieker.analysis.stage.tracediagnosis.AllowedRecordsFilter;
import kieker.analysis.stage.tracediagnosis.BeginEndOfMonitoringDetector; import kieker.analysis.stage.tracediagnosis.BeginEndOfMonitoringDetector;
import kieker.analysis.stage.tracediagnosis.OperationCallHandlerComposite; import kieker.analysis.stage.tracediagnosis.OperationCallHandlerComposite;
...@@ -100,7 +101,9 @@ public class TraceAnalysisConfiguration extends Configuration { ...@@ -100,7 +101,9 @@ public class TraceAnalysisConfiguration extends Configuration {
super.connectPorts(graphDistributor2.getNewOutputPort(), dotGraphWriter2.getInputPort()); super.connectPorts(graphDistributor2.getNewOutputPort(), dotGraphWriter2.getInputPort());
DependencyCreatorStage dependencyCreatorStage = new DependencyCreatorStage(); DependencyCreatorStage dependencyCreatorStage = new DependencyCreatorStage();
DependencyStatisticsDecoratorStage dependencyStatisticsDecoratorStage = new DependencyStatisticsDecoratorStage();
super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), dependencyCreatorStage.getInputPort()); super.connectPorts(aggregatedTraceDistributor.getNewOutputPort(), dependencyCreatorStage.getInputPort());
super.connectPorts(dependencyCreatorStage.getOutputPort(), dependencyStatisticsDecoratorStage.getInputPort());
/* /*
* *
......
...@@ -18,12 +18,6 @@ public class DependencyCreatorStage extends AbstractTransformation<AggregatedTra ...@@ -18,12 +18,6 @@ public class DependencyCreatorStage extends AbstractTransformation<AggregatedTra
@Override @Override
public void onTerminating() throws Exception { // NOPMD (the throws clause is forced by the framework) public void onTerminating() throws Exception { // NOPMD (the throws clause is forced by the framework)
// TODO Update Statistics
// TODO Temporary final stage -> print result
operationsDependency.printDependenncies();
operationsDependency.printOperations();
this.getOutputPort().send(operationsDependency); this.getOutputPort().send(operationsDependency);
super.onTerminating(); super.onTerminating();
......
package kieker.analysis.dev; package kieker.analysis.dev;
import java.util.List;
import java.util.stream.Collectors;
import kieker.analysis.traceanalysisdomain.AggregatedOperationCall;
import kieker.analysis.traceanalysisutil.Statistics;
import kieker.analysis.traceanalysisutil.StatisticsUtility;
/**
* @author Sören Henning
*
*/
// TODO Maybe make static
public class DependencyStatisticsDecorator { public class DependencyStatisticsDecorator {
public void decorate(final OperationsDependency operationsDependency) { public void decorate(final OperationsDependency operationsDependency) {
for (AggregatedOperationCall operation : operationsDependency.getOperations()) {
List<Long> durations = operation.getBaseOperationCalls().stream()
.map(call -> call.getDuration()).collect(Collectors.toList());
Statistics statistics = StatisticsUtility.calculateStatistics(durations);
operation.setTotalDuration(statistics.getTotalDuration());
operation.setMaxDuration(statistics.getMaxDuration());
operation.setMinDuration(statistics.getMinDuration());
operation.setMeanDuration(statistics.getMeanDuration());
operation.setMedianDuration(statistics.getMedianDuration());
}
} }
} }
...@@ -2,14 +2,24 @@ package kieker.analysis.dev; ...@@ -2,14 +2,24 @@ package kieker.analysis.dev;
import teetime.stage.basic.AbstractTransformation; import teetime.stage.basic.AbstractTransformation;
/**
* @author Sören Henning
*
*/
public class DependencyStatisticsDecoratorStage extends AbstractTransformation<OperationsDependency, OperationsDependency> { public class DependencyStatisticsDecoratorStage extends AbstractTransformation<OperationsDependency, OperationsDependency> {
private final DependencyStatisticsDecorator statisticsDecorator = new DependencyStatisticsDecorator();
@Override @Override
protected void execute(final OperationsDependency element) { protected void execute(final OperationsDependency operationsDependency) {
statisticsDecorator.decorate(operationsDependency);
// TODO // TODO Temporary final stage -> print result
operationsDependency.printDependenncies();
operationsDependency.printOperations();
this.getOutputPort().send(element); this.getOutputPort().send(operationsDependency);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment