Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ kieker-examples/analysis/trace-analysis/kieker.log
*.iml
*.iws

# Visual Studio Code
.vscode/

**/output-html/**
3 changes: 2 additions & 1 deletion bin/dev/release-check-extended.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function check_bin_archive {
fi

# now perform some trace analysis tests and compare results with reference data
for testset in "kieker-20100830-082225522-UTC-example-plots" "kieker-20141008-101258768-UTC-example-plots" \
for testset in "kieker-20100830-082225522-UTC-example-plots" \
"kieker-20141008-101258768-UTC-example-plots" \
"kieker-20141008-101258768-UTC-repairEventBasedTraces-example-plots" \
"kieker-20141009-160413833-UTC-operationExecutionsConstructors-example-plots" \
"kieker-20141009-163010944-UTC-constructor-events-example-plots"; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Aggregated-Assembly-Call-Tree \
--print-Deployment-Equivalence-Classes \
--print-Assembly-Equivalence-Classes \
--short-labels
--short-labels \
--print-System-Model

# Dependency graphs with responseTimes
${TRACE_ANALYSIS_SH} \
Expand All @@ -70,7 +71,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Assembly-Component-Dependency-Graph responseTimes-ns \
--plot-Deployment-Operation-Dependency-Graph responseTimes-us \
--plot-Assembly-Operation-Dependency-Graph responseTimes-ns \
--short-labels
--short-labels \
--print-System-Model

# Deployment-level representatives: 6488138950668976141 6488138950668976129 6488138950668976130 6488138950668976131
# Assembly-level representative: 6488138950668976129
Expand All @@ -84,7 +86,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Call-Trees \
--print-Message-Traces \
--print-Execution-Traces \
--short-labels
--short-labels \
--print-System-Model

# Should be enabled only if the reference pdfs shall be created (otherwise the release test script is broken):
#${FILE_CONVERTER_SH} "./${OUTDIR}" pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Aggregated-Assembly-Call-Tree \
--print-Deployment-Equivalence-Classes \
--print-Assembly-Equivalence-Classes \
--short-labels
--short-labels \
--print-System-Model

# Dependency graphs with responseTimes
#${TRACE_ANALYSIS_SH} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Aggregated-Assembly-Call-Tree \
--print-Deployment-Equivalence-Classes \
--print-Assembly-Equivalence-Classes \
--short-labels
--short-labels \
--print-System-Model

# Should be enabled only if the reference pdfs shall be created (otherwise the release test script is broken):
#${FILE_CONVERTER_SH} "./${OUTDIR}" pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Aggregated-Assembly-Call-Tree \
--print-Deployment-Equivalence-Classes \
--print-Assembly-Equivalence-Classes \
--short-labels
--short-labels \
--print-System-Model

# Should be enabled only if the reference pdfs shall be created (otherwise the release test script is broken):
#${FILE_CONVERTER_SH} "./${OUTDIR}" pdf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ ${TRACE_ANALYSIS_SH} \
--plot-Aggregated-Assembly-Call-Tree \
--print-Deployment-Equivalence-Classes \
--print-Assembly-Equivalence-Classes \
--short-labels
--short-labels \
--print-System-Model

# Should be enabled only if the reference pdfs shall be created (otherwise the release test script is broken):
#${FILE_CONVERTER_SH} "./${OUTDIR}" pdf
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include 'tools:rewrite-log-entries'
include 'tools:sar'
include 'tools:trace-analysis'
include 'tools:trace-analysis-gui'
include 'tools:trace-analysis-new'
include 'tools:trace-analysis-old'
include 'extension-kafka'
include 'extension-cassandra'
include 'examples'
7 changes: 5 additions & 2 deletions tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ dependencies {
implementation "ch.qos.logback:logback-classic:$libLogbackVersion"
implementation "org.slf4j:slf4j-api:$libSlf4jApiVersion"



// PlantUML for generating diagrams / Dependencies for PDF generation
implementation 'net.sourceforge.plantuml:plantuml:1.2025.2'
implementation 'org.apache.pdfbox:pdfbox:2.0.27'
implementation 'org.apache.xmlgraphics:batik-all:1.17' // Complete Batik for PlantUML PDF support
implementation 'org.apache.xmlgraphics:fop:2.9'

// Some dependencies for the HTTP connector of the KDB
api fileTree(dir: rootProject.file('kieker-examples/JavaEEServletContainerExample/jetty/lib'), include: 'jetty-*.jar')
Expand Down
13 changes: 13 additions & 0 deletions tools/src-resources/sequence-preamble.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
skinparam style strictuml
hide footbox

skinparam sequence {
ActorBorderColor black
ActorBackgroundColor white

ParticipantBorderColor black
ParticipantBackgroundColor white

LifeLineBorderColor black
LifeLineBackgroundColor white
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.tools.trace.analysis;
package kieker.tools.common;

import com.beust.jcommander.IParameterValidator;
import com.beust.jcommander.ParameterException;
Expand Down
26 changes: 26 additions & 0 deletions tools/src/kieker/tools/common/GraphicsEngineType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/***************************************************************************
* Copyright 2022 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.tools.common;

/**
* Types of trace analysis configurations.
*
* @author Yorrick Josuttis
*/
public enum GraphicsEngineType {
DOTPIC,
PLANTUML
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
***************************************************************************/

package kieker.tools.trace.analysis;
package kieker.tools.common;

/**
* Externalized Strings from {@link TraceAnalysisTool}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package kieker.tools.trace.analysis;
package kieker.tools.common;

import java.io.File;
import java.lang.reflect.Field;
Expand All @@ -33,6 +33,7 @@

/**
* @author Reiner Jung
* @author Yorrick Josuttis
*
* @since 1.15
*/
Expand All @@ -56,40 +57,52 @@ public final class TraceAnalysisParameters { // NOPMD configuration class
@Parameter(names = { "-p", "--output-filename-prefix" }, description = "Prefix for output filenames")
private String prefix;

@Parameter(names = "--plot-Deployment-Sequence-Diagrams", description = "Generate and store deployment-level sequence diagrams (.pic)")
@Parameter(names = "--graphics-engine", description = "Choose graphics engine")
private GraphicsEngineType graphicsEngine;

@Parameter(names = "--png", description = "Generate PNG images (only for PlantUML graphics engine)")
private boolean png;

@Parameter(names = "--svg", description = "Generate SVG images (only for PlantUML graphics engine)")
private boolean svg;

@Parameter(names = "--pdf", description = "Generate PDF documents (only for PlantUML graphics engine)")
private boolean pdf;

@Parameter(names = "--plot-Deployment-Sequence-Diagrams", description = "Generate and store deployment-level sequence diagrams")
private boolean plotDeploymentSequenceDiagrams;

@Parameter(names = "--plot-Assembly-Sequence-Diagrams", description = "Generate and store assembly-level sequence diagrams (.pic)")
@Parameter(names = "--plot-Assembly-Sequence-Diagrams", description = "Generate and store assembly-level sequence diagrams")
private boolean plotAssemblySequenceDiagrams;

@Parameter(names = "--plot-Deployment-Component-Dependency-Graph", validateWith = DecoratorValidator.class,
description = "Generate and store a deployment-level component dependency graph (.dot)")
description = "Generate and store a deployment-level component dependency graph")
private List<String> plotDeploymentComponentDependencyGraph;

@Parameter(names = "--plot-Assembly-Component-Dependency-Graph", validateWith = DecoratorValidator.class,
description = "Generate and store an assembly-level component dependency graph (.dot)")
description = "Generate and store an assembly-level component dependency graph")
private List<String> plotAssemblyComponentDependencyGraph;

@Parameter(names = "--plot-Container-Dependency-Graph", description = "Generate and store a container dependency graph (.dot file)")
@Parameter(names = "--plot-Container-Dependency-Graph", description = "Generate and store a container dependency graph")
private boolean plotContainerDependencyGraph;

@Parameter(names = "--plot-Deployment-Operation-Dependency-Graph", variableArity = true, validateWith = DecoratorValidator.class,
description = "Generate and store a deployment-level operation dependency graph (.dot)")
description = "Generate and store a deployment-level operation dependency graph")
private List<String> plotDeploymentOperationDependencyGraph;

@Parameter(names = "--plot-Assembly-Operation-Dependency-Graph", variableArity = true, validateWith = DecoratorValidator.class,
description = "Generate and store an assembly-level operation dependency graph (.dot)")
description = "Generate and store an assembly-level operation dependency graph")
private List<String> plotAssemblyOperationDependencyGraph;

@Parameter(names = "--plot-Aggregated-Deployment-Call-Tree",
description = "Generate and store an aggregated deployment-level call tree (.dot)")
description = "Generate and store an aggregated deployment-level call tree")
private boolean plotAggregatedDeploymentCallTree;

@Parameter(names = "--plot-Aggregated-Assembly-Call-Tree",
description = "Generate and store an aggregated assembly-level call tree (.dot)")
description = "Generate and store an aggregated assembly-level call tree")
private boolean plotAggregatedAssemblyCallTree;

@Parameter(names = "--plot-Call-Trees", description = "Generate and store call trees for the selected traces (.dot)")
@Parameter(names = "--plot-Call-Trees", description = "Generate and store call trees for the selected traces")
private boolean plotCallTrees;

@Parameter(names = "--print-Message-Traces", description = "Save message trace representations of valid traces (.txt)")
Expand Down Expand Up @@ -203,6 +216,22 @@ public String getPrefix() {
return this.prefix;
}

public GraphicsEngineType getGraphicsEngineType() {
return this.graphicsEngine;
}

public boolean isPng() {
return this.png;
}

public boolean isSvg() {
return this.svg;
}

public boolean isPdf() {
return this.pdf;
}

public boolean isPlotDeploymentSequenceDiagrams() {
return this.plotDeploymentSequenceDiagrams;
}
Expand Down
21 changes: 12 additions & 9 deletions tools/src/kieker/visualization/trace/GraphWriterPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

Expand All @@ -47,6 +48,7 @@
* given graph.
*
* @author Holger Knoche
* @author Yorrick Josuttis
*
* @since 1.6
*/
Expand All @@ -59,7 +61,7 @@ public class GraphWriterPlugin extends AbstractConsumerStage<AbstractGraph<?, ?,
private static final ConcurrentMap<Class<? extends AbstractGraph<?, ?, ?>>, Class<? extends AbstractGraphFormatter<?>>> FORMATTER_REGISTRY = new ConcurrentHashMap<>();

private final String outputPathName;
private final String outputFileName;
private final String outputFileNamePrefix;
private final boolean includeWeights;
private final boolean useShortLabels;
private final boolean plotLoops;
Expand All @@ -77,21 +79,21 @@ public class GraphWriterPlugin extends AbstractConsumerStage<AbstractGraph<?, ?,
*
* @param outputPathName
* base path name for the output directory
* @param outputFileName
* filename to be used within the directory
* @param outputFileNamePrefix
* a file-name-prefix prepend to the filename
* @param includeWeights
* include weights in plotting
* @param useShortLabels
* use short labels
* @param plotLoops
* plot loops
*/
public GraphWriterPlugin(final String outputPathName, final String outputFileName, final boolean includeWeights, final boolean useShortLabels,
public GraphWriterPlugin(final String outputPathName, final String outputFileNamePrefix, final boolean includeWeights, final boolean useShortLabels,
final boolean plotLoops) {
super();

this.outputPathName = outputPathName;
this.outputFileName = outputFileName;
this.outputFileNamePrefix = outputFileNamePrefix;
this.includeWeights = includeWeights;
this.useShortLabels = useShortLabels;
this.plotLoops = plotLoops;
Expand Down Expand Up @@ -121,11 +123,12 @@ private static AbstractGraphFormatter<?> createFormatter(final AbstractGraph<?,
}

private String getOutputFileName(final AbstractGraphFormatter<?> formatter) {
if (this.outputFileName.length() == 0) { // outputFileName cannot be null
return formatter.getDefaultFileName();
} else {
return this.outputFileName;
final String defaultName = formatter.getDefaultFileName();
final String fileNamePrefix = Objects.toString(this.outputFileNamePrefix, "");
if (fileNamePrefix.isEmpty()) {
return defaultName;
}
return fileNamePrefix + defaultName;
}

/**
Expand Down
Loading