From 0013c84a80dee7d59b7080e6c214614653383401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <stu114708@informatik.uni-kiel.de> Date: Mon, 20 Jun 2016 19:18:40 +0200 Subject: [PATCH] removed deprecated classes --- .../ContainerStatisticsDecoratorStage.java | 47 ---------- .../analysis/dev/DependencyGraphCreator.java | 81 ----------------- .../DotComponentsDependencyExportStage.java | 89 ------------------ .../DotContainersDependencyExportStage.java | 90 ------------------- .../DotOperationsDependencyExportStage.java | 88 ------------------ 5 files changed, 395 deletions(-) delete mode 100644 src/main/java/kieker/analysis/dev/ContainerStatisticsDecoratorStage.java delete mode 100644 src/main/java/kieker/analysis/dev/DependencyGraphCreator.java delete mode 100644 src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotComponentsDependencyExportStage.java delete mode 100644 src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotContainersDependencyExportStage.java delete mode 100644 src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotOperationsDependencyExportStage.java diff --git a/src/main/java/kieker/analysis/dev/ContainerStatisticsDecoratorStage.java b/src/main/java/kieker/analysis/dev/ContainerStatisticsDecoratorStage.java deleted file mode 100644 index 1c17eec7..00000000 --- a/src/main/java/kieker/analysis/dev/ContainerStatisticsDecoratorStage.java +++ /dev/null @@ -1,47 +0,0 @@ -package kieker.analysis.dev; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -import kieker.analysis.domain.systemdependency.Component; -import kieker.analysis.domain.systemdependency.Container; -import kieker.analysis.domain.systemdependency.Operation; -import kieker.analysis.domain.systemdependency.SoftwareSystem; -import kieker.analysis.traceanalysisutil.Statistics; -import kieker.analysis.traceanalysisutil.StatisticsUtility; - -import teetime.stage.basic.AbstractTransformation; - -//TODO Not required -@Deprecated -public class ContainerStatisticsDecoratorStage extends AbstractTransformation<SoftwareSystem, SoftwareSystem> { - - @Override - protected void execute(final SoftwareSystem softwareSystem) { - - for (Container container : softwareSystem.getContainers()) { - - // TODO How to handle Statistics? - // All durations of all OperationCalls - - List<Long> durations = new ArrayList<>(); - for (Component component : container.getComponents()) { - for (Operation operation : component.getOperations()) { - List<Long> operationsDurations = operation.getOperationCalls().stream().map(c -> c.getDuration()).collect(Collectors.toList()); - durations.addAll(operationsDurations); - } - } - - final Statistics statistics = StatisticsUtility.calculateStatistics(durations); - container.setTotalDuration(statistics.getTotalDuration()); - container.setMaxDuration(statistics.getMaxDuration()); - container.setMinDuration(statistics.getMinDuration()); - container.setMeanDuration(statistics.getMeanDuration()); - container.setMedianDuration(statistics.getMedianDuration()); - - } - - } - -} diff --git a/src/main/java/kieker/analysis/dev/DependencyGraphCreator.java b/src/main/java/kieker/analysis/dev/DependencyGraphCreator.java deleted file mode 100644 index eab6277d..00000000 --- a/src/main/java/kieker/analysis/dev/DependencyGraphCreator.java +++ /dev/null @@ -1,81 +0,0 @@ -package kieker.analysis.dev; - -import java.util.Collection; - -import kieker.analysis.domain.systemdependency.Component; -import kieker.analysis.domain.systemdependency.Container; -import kieker.analysis.domain.systemdependency.Operation; -import kieker.analysis.domain.systemdependency.SoftwareSystem; -import kieker.analysis.domain.systemdependency.SystemEntity; -import kieker.analysis.util.graph.Graph; -import kieker.analysis.util.graph.Vertex; -import kieker.analysis.util.graph.impl.GraphImpl; - -@Deprecated -public class DependencyGraphCreator { - - private final boolean containers = true; - private final boolean components = true; - private final boolean operations = true; - - private final boolean containerDependencies = true; - private final boolean componentDependencies = true; - private final boolean operationDependencies = true; - - public Graph create(final SoftwareSystem softwareSystem) { - - Graph graph = new GraphImpl(); - - addContainers(graph, softwareSystem.getContainers()); - - return graph; - } - - private void addContainers(final Graph graph, final Collection<Container> containers) { - for (Container container : containers) { - if (this.containers) { - Vertex vertex = graph.addVertex(container.getIdentifier()); - vertex.setProperty("ContainerName", container.getName()); - addDurationStatistics(vertex, container); - addComponents(vertex.addChildGraph(), container.getComponents()); - } else { - addComponents(graph, container.getComponents()); - } - } - } - - private void addComponents(final Graph graph, final Collection<Component> components) { - for (Component component : components) { - if (this.components) { - Vertex vertex = graph.addVertex(component.getIdentifier()); - vertex.setProperty("ComponentName", component.getName()); - vertex.setProperty("ContainerName", component.getContainer().getName()); - addDurationStatistics(vertex, component); - addOperations(vertex.addChildGraph(), component.getOperations()); - } else { - addOperations(graph, component.getOperations()); - } - } - } - - private void addOperations(final Graph graph, final Collection<Operation> operations) { - for (Operation operation : operations) { - if (this.operations) { - Vertex vertex = graph.addVertex(operation.getIdentifier()); - vertex.setProperty("OperationName", operation.getName()); - vertex.setProperty("ComponentName", operation.getComponent().getName()); - vertex.setProperty("ContainerName", operation.getComponent().getContainer().getName()); - addDurationStatistics(vertex, operation); - } - } - } - - private void addDurationStatistics(final Vertex vertex, final SystemEntity systemEntity) { - vertex.setProperty("MaxDuration", systemEntity.getMaxDuration()); - vertex.setProperty("MinDuration", systemEntity.getMinDuration()); - vertex.setProperty("MeanDuration", systemEntity.getMeanDuration()); - vertex.setProperty("MedianDuration", systemEntity.getMedianDuration()); - vertex.setProperty("TotalDuration", systemEntity.getTotalDuration()); - } - -} diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotComponentsDependencyExportStage.java b/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotComponentsDependencyExportStage.java deleted file mode 100644 index 4f54d524..00000000 --- a/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotComponentsDependencyExportStage.java +++ /dev/null @@ -1,89 +0,0 @@ -package kieker.analysis.dev.dependencygraphs.dot; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; - -import kieker.analysis.util.graph.Vertex; -import kieker.analysis.util.graph.export.dot.DotFileWriterStage; -import kieker.analysis.util.graph.util.dot.attributes.DotClusterAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotEdgeAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotGraphAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotNodeAttribute; - -@Deprecated -public class DotComponentsDependencyExportStage extends DotFileWriterStage { - - public DotComponentsDependencyExportStage(final String outputDirectory) { - super(outputDirectory); - this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR"); - this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "box"); - this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper()); - this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new ComponentVertexMapper()); - this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString())); - // Styling - // Something like this would be cool: - // this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new PropertyMapper("calls")); - } - - // TODO Make public and not nested, join with the other vertex mappers - private class ComponentVertexMapper implements Function<Vertex, String> { - - @Override - public String apply(final Vertex vertex) { - final StringBuilder statistics = new StringBuilder(); - statistics.append("<<deployment component>>\\n"); - statistics.append(vertex.getProperty("Name").toString()); - statistics.append("\\n"); - statistics.append(generateStatistics(vertex)); - return statistics.toString(); - } - - private String generateStatistics(final Vertex vertex) { - final String temporalUnit = "xs"; // TODO temp - final List<String> statisticStrings = new ArrayList<>(5); - if (vertex.getProperty("MinDuration") != null) { - statisticStrings.add("min: " + vertex.getProperty("MinDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MaxDuration") != null) { - statisticStrings.add("max: " + vertex.getProperty("MaxDuration").toString() + temporalUnit); - } - if (vertex.getProperty("TotalDuration") != null) { - statisticStrings.add("total: " + vertex.getProperty("TotalDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MeanDuration") != null) { - statisticStrings.add("avg: " + vertex.getProperty("MeanDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MedianDuration") != null) { - statisticStrings.add("med: " + vertex.getProperty("MedianDuration").toString() + temporalUnit); - } - - // If there are more than 3 statistics elements add a line break after the 3rd last - if (statisticStrings.size() > 3) { - final int thirdLast = statisticStrings.size() - 3; - statisticStrings.set(thirdLast, statisticStrings.get(thirdLast).concat("\\n")); - } - - return statisticStrings.stream().collect(Collectors.joining(", ")); - } - - } - - private class ClusterMapper implements Function<Vertex, String> { - - @Override - public String apply(final Vertex vertex) { - switch (vertex.getProperty("Type").toString()) { - case "Container": - return "<<execution container>>\\n" + vertex.getProperty("Name").toString(); - case "Component": - return "<<deployment component>>\\n" + vertex.getProperty("Name").toString(); - default: - return null; - } - } - - } - -} diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotContainersDependencyExportStage.java b/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotContainersDependencyExportStage.java deleted file mode 100644 index 67d96549..00000000 --- a/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotContainersDependencyExportStage.java +++ /dev/null @@ -1,90 +0,0 @@ -package kieker.analysis.dev.dependencygraphs.dot; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; - -import kieker.analysis.util.graph.Vertex; -import kieker.analysis.util.graph.export.dot.DotFileWriterStage; -import kieker.analysis.util.graph.util.dot.attributes.DotClusterAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotEdgeAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotGraphAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotNodeAttribute; - -@Deprecated -public class DotContainersDependencyExportStage extends DotFileWriterStage { - - public DotContainersDependencyExportStage(final String outputDirectory) { - super(outputDirectory); - this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR"); - this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "box3d"); - this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper()); - this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new ContainerVertexMapper()); - this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString())); - // Styling - // Something like this would be cool: - // this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new PropertyMapper("calls")); - } - - // TODO Make public and not nested, join with the other vertex mappers - private class ContainerVertexMapper implements Function<Vertex, String> { - - @Override - public String apply(final Vertex vertex) { - final StringBuilder statistics = new StringBuilder(); - statistics.append("<<execution container>>\\n"); - statistics.append(vertex.getProperty("Name").toString()); - statistics.append("\\n"); - statistics.append(generateStatistics(vertex)); - return statistics.toString(); - } - - private String generateStatistics(final Vertex vertex) { - final String temporalUnit = "xs"; // TODO temp - final List<String> statisticStrings = new ArrayList<>(5); - if (vertex.getProperty("MinDuration") != null) { - statisticStrings.add("min: " + vertex.getProperty("MinDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MaxDuration") != null) { - statisticStrings.add("max: " + vertex.getProperty("MaxDuration").toString() + temporalUnit); - } - if (vertex.getProperty("TotalDuration") != null) { - statisticStrings.add("total: " + vertex.getProperty("TotalDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MeanDuration") != null) { - statisticStrings.add("avg: " + vertex.getProperty("MeanDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MedianDuration") != null) { - statisticStrings.add("med: " + vertex.getProperty("MedianDuration").toString() + temporalUnit); - } - - // If there are more than 3 statistics elements add a line break after the 3rd last - if (statisticStrings.size() > 3) { - final int thirdLast = statisticStrings.size() - 3; - statisticStrings.set(thirdLast, statisticStrings.get(thirdLast).concat("\\n")); - } - - return statisticStrings.stream().collect(Collectors.joining(", ")); - } - - } - - // Not used in this class - private class ClusterMapper implements Function<Vertex, String> { - - @Override - public String apply(final Vertex vertex) { - switch (vertex.getProperty("Type").toString()) { - case "Container": - return "<<execution container>>\\n" + vertex.getProperty("Name").toString(); - case "Component": - return "<<deployment component>>\\n" + vertex.getProperty("Name").toString(); - default: - return null; - } - } - - } - -} diff --git a/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotOperationsDependencyExportStage.java b/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotOperationsDependencyExportStage.java deleted file mode 100644 index d6cee46d..00000000 --- a/src/main/java/kieker/analysis/dev/dependencygraphs/dot/DotOperationsDependencyExportStage.java +++ /dev/null @@ -1,88 +0,0 @@ -package kieker.analysis.dev.dependencygraphs.dot; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; - -import kieker.analysis.util.graph.Vertex; -import kieker.analysis.util.graph.export.dot.DotFileWriterStage; -import kieker.analysis.util.graph.util.dot.attributes.DotClusterAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotEdgeAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotGraphAttribute; -import kieker.analysis.util.graph.util.dot.attributes.DotNodeAttribute; - -@Deprecated -public class DotOperationsDependencyExportStage extends DotFileWriterStage { - - public DotOperationsDependencyExportStage(final String outputDirectory) { - super(outputDirectory); - this.exportConfiguration.addGraphAttribute(DotGraphAttribute.RANKDIR, g -> "LR"); - this.exportConfiguration.addDefaultNodeAttribute(DotNodeAttribute.SHAPE, g -> "oval"); - this.exportConfiguration.addClusterAttribute(DotClusterAttribute.LABEL, new ClusterMapper()); - this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new OperationVertexMapper()); - this.exportConfiguration.addEdgeAttribute(DotEdgeAttribute.LABEL, (e -> e.getProperty("calls").toString())); - // Styling - // Something like this would be cool: - // this.exportConfiguration.addNodeAttribute(DotNodeAttribute.LABEL, new PropertyMapper("calls")); - } - - // TODO Make public and not nested, join with the other vertex mappers - private class OperationVertexMapper implements Function<Vertex, String> { - - @Override - public String apply(final Vertex vertex) { - final StringBuilder statistics = new StringBuilder(); - statistics.append(vertex.getProperty("Name").toString()); - statistics.append("\\n"); - statistics.append(generateStatistics(vertex)); - return statistics.toString(); - } - - private String generateStatistics(final Vertex vertex) { - final String temporalUnit = "xs"; // TODO temp - final List<String> statisticStrings = new ArrayList<>(5); - if (vertex.getProperty("MinDuration") != null) { - statisticStrings.add("min: " + vertex.getProperty("MinDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MaxDuration") != null) { - statisticStrings.add("max: " + vertex.getProperty("MaxDuration").toString() + temporalUnit); - } - if (vertex.getProperty("TotalDuration") != null) { - statisticStrings.add("total: " + vertex.getProperty("TotalDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MeanDuration") != null) { - statisticStrings.add("avg: " + vertex.getProperty("MeanDuration").toString() + temporalUnit); - } - if (vertex.getProperty("MedianDuration") != null) { - statisticStrings.add("med: " + vertex.getProperty("MedianDuration").toString() + temporalUnit); - } - - // If there are more than 3 statistics elements add a line break after the 3rd last - if (statisticStrings.size() > 3) { - final int thirdLast = statisticStrings.size() - 3; - statisticStrings.set(thirdLast, statisticStrings.get(thirdLast).concat("\\n")); - } - - return statisticStrings.stream().collect(Collectors.joining(", ")); - } - - } - - private class ClusterMapper implements Function<Vertex, String> { - - @Override - public String apply(final Vertex vertex) { - switch (vertex.getProperty("Type").toString()) { - case "Container": - return "<<execution container>>\\n" + vertex.getProperty("Name").toString(); - case "Component": - return "<<deployment component>>\\n" + vertex.getProperty("Name").toString(); - default: - return null; - } - } - - } - -} -- GitLab