diff --git a/analysis/src/main/java/org/oceandsl/analysis/RewriteBeforeAndAfterEventsStage.java b/analysis/src/main/java/org/oceandsl/analysis/RewriteBeforeAndAfterEventsStage.java index 4fbc5b0165a74e7892282cb1f3339f4bb3a2b3ba..39740967f95f180055c40d3a989a77d87e90c5a5 100644 --- a/analysis/src/main/java/org/oceandsl/analysis/RewriteBeforeAndAfterEventsStage.java +++ b/analysis/src/main/java/org/oceandsl/analysis/RewriteBeforeAndAfterEventsStage.java @@ -1,6 +1,18 @@ -/** +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) * - */ + * 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 org.oceandsl.analysis; import java.io.BufferedReader; @@ -20,8 +32,11 @@ import teetime.framework.AbstractConsumerStage; import teetime.framework.OutputPort; /** - * @author reiner + * Rewrite logging information collected by the kieker-lang-pack-c and resolve function pointer + * references to actual function calls and files. * + * @author Reiner Jung + * @since 1.0 */ public class RewriteBeforeAndAfterEventsStage extends AbstractConsumerStage<IMonitoringRecord> { @@ -31,9 +46,13 @@ public class RewriteBeforeAndAfterEventsStage extends AbstractConsumerStage<IMon private final Map<String, AddrOutput> addressMap = new HashMap<>(); private final File modelExecutable; - public RewriteBeforeAndAfterEventsStage(final File addrLineExecutable, final File modelExecutable) { + private final String prefix; + + public RewriteBeforeAndAfterEventsStage(final File addrLineExecutable, final File modelExecutable, + final String prefix) { this.addrlineExecutable = addrLineExecutable; this.modelExecutable = modelExecutable; + this.prefix = prefix; } @Override @@ -76,8 +95,8 @@ public class RewriteBeforeAndAfterEventsStage extends AbstractConsumerStage<IMon if (matcher.find()) { final Integer linenumber = matcher.group(3).equals("?") ? null : Integer.parseInt(matcher.group(3)); - RewriteBeforeAndAfterEventsStage.this.addressMap.put(address, - new AddrOutput(matcher.group(1), matcher.group(2), linenumber)); + RewriteBeforeAndAfterEventsStage.this.addressMap.put(address, new AddrOutput(matcher.group(1), + RewriteBeforeAndAfterEventsStage.this.fixSignature(matcher.group(2)), linenumber)); } } @@ -88,6 +107,14 @@ public class RewriteBeforeAndAfterEventsStage extends AbstractConsumerStage<IMon } } + private String fixSignature(final String signature) { + if (signature.startsWith(this.prefix)) { + return signature.substring(this.prefix.length()); + } else { + return signature; + } + } + class AddrOutput { private final String name; diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelMain.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelMain.java index 9190fae55fda3d6f169f6b2c5210876d5502068b..8a44e00e40dcf21ea459350dace8d53b9357493e 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelMain.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelMain.java @@ -1,6 +1,18 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) + * + * 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 org.oceandsl.architecture.model; import java.io.File; @@ -21,6 +33,12 @@ import kieker.common.configuration.Configuration; import kieker.common.exception.ConfigurationException; import kieker.tools.common.AbstractService; +/** + * Architecture analysis main class. + * + * @author Reiner Jung + * @since 1.0 + */ public class ArchitectureModelMain extends AbstractService<TeetimeConfiguration, ArchitectureModelSettings> { private final TypeModel typeModel = TypeFactory.eINSTANCE.createTypeModel(); diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelSettings.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelSettings.java index 10e9fde9d77846259bd74909a133c1b15d73e9a1..9e09a25e799baf7a6f1abf1f4e9e4a2d37538a00 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelSettings.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ArchitectureModelSettings.java @@ -1,6 +1,18 @@ -/** +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) * - */ + * 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 org.oceandsl.architecture.model; import java.io.File; @@ -9,8 +21,10 @@ import com.beust.jcommander.Parameter; import com.beust.jcommander.converters.FileConverter; /** - * @author reiner + * All settings including command line parameters for the analysis. * + * @author Reiner Jung + * @since 1.0 */ public class ArchitectureModelSettings { diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountEvents.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountEvents.java deleted file mode 100644 index 3e1ae0b3a2c3873c79245c6e2c088ef4055b3d36..0000000000000000000000000000000000000000 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountEvents.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * - */ -package org.oceandsl.architecture.model; - -import teetime.stage.basic.AbstractTransformation; - -/** - * @author reiner - * - */ -public class CountEvents<T> extends AbstractTransformation<T, T> { - - private long counter; - private final long interval; - - public CountEvents(final long interval) { - this.interval = interval; - } - - @Override - protected void execute(final T element) throws Exception { - this.counter++; - if ((this.counter % this.interval) == 0) { - this.logger.info("Received {} events.", this.counter); - } - this.outputPort.send(element); - } - - @Override - protected void onTerminating() { - this.logger.info("Received {} events.", this.counter); - super.onTerminating(); - } -} diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountEventsStage.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountEventsStage.java new file mode 100644 index 0000000000000000000000000000000000000000..9cd11c2a54f2a736a2e55352c16975e7a601164f --- /dev/null +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountEventsStage.java @@ -0,0 +1,54 @@ +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) + * + * 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 org.oceandsl.architecture.model; + +import teetime.stage.basic.AbstractTransformation; + +/** + * Counts all events and hands them to the next filter unchanged. The stage outputs the number of + * events for every <code>interval</code> event occurrence and on termination. Output is written to + * info log channel. + * + * @param <T> + * event type + * + * @author Reiner Jung + * @since 1.0 + */ +public class CountEventsStage<T> extends AbstractTransformation<T, T> { + + private long counter; + private final long interval; + + public CountEventsStage(final long interval) { + this.interval = interval; + } + + @Override + protected void execute(final T element) throws Exception { + this.counter++; + if ((this.counter % this.interval) == 0) { + this.logger.info("Received {} events.", this.counter); + } + this.outputPort.send(element); + } + + @Override + protected void onTerminating() { + this.logger.info("Received {} events.", this.counter); + super.onTerminating(); + } +} diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountUniqueCalls.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountUniqueCalls.java index d52c189e2fb7099e0575ae2fabac2c4bc103e382..a20f3c1e40b2e27eb3bb2e5e2a1c1c596550693b 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountUniqueCalls.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CountUniqueCalls.java @@ -1,6 +1,18 @@ -/** +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) * - */ + * 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 org.oceandsl.architecture.model; import java.util.function.Function; @@ -14,8 +26,11 @@ import kieker.analysisteetime.model.analysismodel.deployment.DeployedOperation; import kieker.analysisteetime.model.analysismodel.execution.ExecutionModel; /** - * @author reiner + * Counts the number of unique operation calles and stores that information in the statistics model. + * See {@link StatisticsDecoratorStage} for detail. * + * @author Reiner Jung + * @since 1.0 */ public class CountUniqueCalls extends StatisticsDecoratorStage<OperationCall> { diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CreateCallsStage.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CreateCallsStage.java index c642fb713fb8c63b2e0743fb2109a5d44f89d8db..91191868ef65e1231e13203a50c3c63fdfcaab46 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CreateCallsStage.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/CreateCallsStage.java @@ -1,6 +1,18 @@ -/** +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) * - */ + * 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 org.oceandsl.architecture.model; import java.util.ArrayList; @@ -21,8 +33,8 @@ import teetime.framework.AbstractConsumerStage; import teetime.framework.OutputPort; /** - * @author reiner - * + * @author Reiner Jung + * @since 1.0 */ public class CreateCallsStage extends AbstractConsumerStage<IFlowRecord> { diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/DedicatedFileNameMapper.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/DedicatedFileNameMapper.java index 3e925bda1aefdf1ac0f52816057be3891e42b8d7..642d7cb2a6626d4012145dda5615fd17201335fe 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/DedicatedFileNameMapper.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/DedicatedFileNameMapper.java @@ -1,3 +1,18 @@ +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) + * + * 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 org.oceandsl.architecture.model; import java.util.function.Function; @@ -5,6 +20,10 @@ import java.util.function.Function; import kieker.analysis.graph.IGraph; import kieker.analysis.graph.util.FileExtension; +/** + * @author Reiner Jung + * @since 1.0 + */ public class DedicatedFileNameMapper implements Function<IGraph, String> { private final String outputDirectory; diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ECallType.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ECallType.java deleted file mode 100644 index 61686637d57352278f73d5e5ed69f1dc361f1e84..0000000000000000000000000000000000000000 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ECallType.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * - */ -package org.oceandsl.architecture.model; - -/** - * @author reiner - * - */ -public enum ECallType { - BEFORE, - AFTER -} diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ExecutionModelGenerationStage.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ExecutionModelGenerationStage.java index cbcdb8aea70edbd7134c1a69086395cf02234f7f..af10a1489f5feecf3929bdd4e255976b2d1e417c 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ExecutionModelGenerationStage.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ExecutionModelGenerationStage.java @@ -1,3 +1,18 @@ +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) + * + * 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 org.oceandsl.architecture.model; import kieker.analysis.util.ComposedKey; @@ -8,6 +23,12 @@ import kieker.analysisteetime.model.analysismodel.execution.ExecutionModel; import teetime.framework.AbstractConsumerStage; import teetime.framework.OutputPort; +/** + * Stage to generate entries for the execution model based on @{link OperationCall}s. + * + * @author Reiner Jung + * @since 1.0 + */ public class ExecutionModelGenerationStage extends AbstractConsumerStage<OperationCall> { private final ExecutionFactory factory = ExecutionFactory.eINSTANCE; diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ModelSerializerStage.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ModelSerializerStage.java index c4621537a92f723682247762684524fd0aad09ed..614f6f65e10f3b2bbb23edeb6a98139bd72eb68a 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ModelSerializerStage.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ModelSerializerStage.java @@ -46,8 +46,10 @@ import kieker.analysisteetime.model.analysismodel.type.TypeModel; import teetime.framework.AbstractConsumerStage; /** - * @author reiner + * Store the in memory model in a slightly simplified model on disc. * + * @author Reiner Jung + * @since 1.0 */ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { @@ -57,18 +59,15 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { private final DeploymentModel deploymentModel; private final ExecutionModel executionModel; private final StatisticsModel statisticsModel; - private final String prefix; public ModelSerializerStage(final TypeModel typeModel, final AssemblyModel assemblyModel, final DeploymentModel deploymentModel, final ExecutionModel executionModel, - final StatisticsModel statisticsModel, final String prefix, final File outputDirectoryPath) - throws IOException { + final StatisticsModel statisticsModel, final File outputDirectoryPath) throws IOException { this.typeModel = typeModel; this.assemblyModel = assemblyModel; this.deploymentModel = deploymentModel; this.executionModel = executionModel; this.statisticsModel = statisticsModel; - this.prefix = prefix; this.outputFile = new File(outputDirectoryPath.getAbsolutePath() + File.separator + "model.json"); } @@ -94,7 +93,7 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { componentMap.put("name", componentType.getName()); componentMap.put("package", componentType.getPackage()); - componentMap.put("signature", this.fixSignature(componentType.getSignature())); + componentMap.put("signature", componentType.getSignature()); final Map<String, Object> operationsMap = new HashMap<>(); for (final Entry<String, OperationType> operationEntry : componentType.getProvidedOperations()) { @@ -108,20 +107,12 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { operationsMap.put(operation.getName(), operationMap); } componentMap.put("operations", operationsMap); - typeModelMap.put(this.fixSignature(componentTypeEntry.getKey()), componentMap); + typeModelMap.put(componentTypeEntry.getKey(), componentMap); } return typeModelMap; } - private String fixSignature(final String signature) { - if (signature.startsWith(this.prefix)) { - return signature.substring(this.prefix.length()); - } else { - return signature; - } - } - private Map<String, Object> createAssemblyModel() { final Map<String, Object> assemblyModelMap = new HashMap<>(); @@ -130,8 +121,7 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { final AssemblyComponent assemblyComponent = assemblyComponentEntry.getValue(); final Map<String, Object> assemblyComponentMap = new HashMap<>(); - assemblyComponentMap.put("component-type", - this.fixSignature(assemblyComponent.getComponentType().getSignature())); + assemblyComponentMap.put("component-type", assemblyComponent.getComponentType().getSignature()); final Map<String, Object> assemblyOperationsMap = new HashMap<>(); for (final Entry<String, AssemblyOperation> assemblyOperationEntry : assemblyComponent @@ -144,7 +134,7 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { } assemblyComponentMap.put("assembly-operations", assemblyOperationsMap); - assemblyModelMap.put(this.fixSignature(assemblyComponentEntry.getKey()), assemblyComponentMap); + assemblyModelMap.put(assemblyComponentEntry.getKey(), assemblyComponentMap); } return assemblyModelMap; @@ -165,7 +155,7 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { final Map<String, Object> deployedComponentMap = new HashMap<>(); deployedComponentMap.put("assembly-component", - this.fixSignature(deployedComponent.getAssemblyComponent().getComponentType().getSignature())); + deployedComponent.getAssemblyComponent().getComponentType().getSignature()); final Map<String, Object> containedOperationsMap = new HashMap<>(); for (final Entry<String, DeployedOperation> containedOperationEntry : deployedComponent .getContainedOperations()) { @@ -177,10 +167,10 @@ public class ModelSerializerStage extends AbstractConsumerStage<Trigger> { containedOperationsMap.put(containedOperationEntry.getKey(), containedOperationMap); } deployedComponentMap.put("contained-operations", containedOperationsMap); - deployedComponentsMap.put(this.fixSignature(deployedComponentEntry.getKey()), deployedComponentMap); + deployedComponentsMap.put(deployedComponentEntry.getKey(), deployedComponentMap); } deploymentContextMap.put("deployed-components", deployedComponentsMap); - deploymentModelMap.put(this.fixSignature(deploymentContextEntry.getKey()), deploymentContextMap); + deploymentModelMap.put(deploymentContextEntry.getKey(), deploymentContextMap); } return deploymentModelMap; diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/OperationCall.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/OperationCall.java index bcac547b6e94c4cfdf95afba6c024242f07365fa..b381cf201b4ad9ab2402152bbde31a327c2c976c 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/OperationCall.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/OperationCall.java @@ -1,13 +1,27 @@ -/** +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) * - */ + * 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 org.oceandsl.architecture.model; import kieker.analysisteetime.model.analysismodel.deployment.DeployedOperation; /** - * @author reiner + * A Single operation call. Data class. * + * @author Reiner Jung + * @since 1.0 */ public class OperationCall { diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ProduceBeforeAndAfterEventsFromOperationCalls.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ProduceBeforeAndAfterEventsFromOperationCalls.java index 8e8f55d2567654cfd4d3cb64febe3837607cb2ed..586cd97a49da02a4cd6d44eb9bd974e88e03cd99 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ProduceBeforeAndAfterEventsFromOperationCalls.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/ProduceBeforeAndAfterEventsFromOperationCalls.java @@ -25,8 +25,11 @@ import kieker.common.record.flow.trace.operation.BeforeOperationEvent; import teetime.stage.basic.AbstractTransformation; /** - * @author reiner + * This filter processes @{link OperationCallEvent} events and transforms them to mini traces which + * are send out. * + * @author Reiner Jung + * @since 1.0 */ public class ProduceBeforeAndAfterEventsFromOperationCalls extends AbstractTransformation<IMonitoringRecord, IFlowRecord> { diff --git a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/TeetimeConfiguration.java b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/TeetimeConfiguration.java index 337f214e3b08333d6b723937237cd77771d65bb7..6cf9894eb550638f25e5aa9383299f48b6298385 100644 --- a/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/TeetimeConfiguration.java +++ b/tools/create-architecture-model/src/main/java/org/oceandsl/architecture/model/TeetimeConfiguration.java @@ -1,6 +1,18 @@ -/** +/*************************************************************************** + * Copyright (C) 2021 OceanDSL (https://oceandsl.uni-kiel.de) * - */ + * 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 org.oceandsl.architecture.model; import java.io.IOException; @@ -40,8 +52,10 @@ import teetime.stage.basic.distributor.Distributor; import teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy; /** - * @author reiner + * Pipe and Filter configuration for the architecture creation tool. * + * @author Reiner Jung + * @since 1.0 */ public class TeetimeConfiguration extends Configuration { @@ -56,7 +70,8 @@ public class TeetimeConfiguration extends Configuration { final LogsReaderCompositeStage reader = new LogsReaderCompositeStage(configuration); final RewriteBeforeAndAfterEventsStage processor = new RewriteBeforeAndAfterEventsStage( - parameterConfiguration.getAddrlineExecutable(), parameterConfiguration.getModelExecutable()); + parameterConfiguration.getAddrlineExecutable(), parameterConfiguration.getModelExecutable(), + parameterConfiguration.getPrefix()); final ProduceBeforeAndAfterEventsFromOperationCalls produceEvents = new ProduceBeforeAndAfterEventsFromOperationCalls( "localhost"); @@ -64,18 +79,15 @@ public class TeetimeConfiguration extends Configuration { final InstanceOfFilter<IMonitoringRecord, IFlowRecord> instanceOfFilter = new InstanceOfFilter<>( IFlowRecord.class); - final CountEvents<IFlowRecord> counter = new CountEvents<>(1000000); + final CountEventsStage<IFlowRecord> counter = new CountEventsStage<>(1000000); final IComponentSignatureExtractor componentSignatureExtractor = new IComponentSignatureExtractor() { @Override public void extract(final ComponentType componentType) { String signature = componentType.getSignature(); - final String prefix = parameterConfiguration.getPrefix(); if (signature == null) { signature = "-- none --"; - } else if (signature.startsWith(prefix)) { - signature = signature.substring(prefix.length()); } final Path path = Paths.get(signature); final String name = path.getName(path.getNameCount() - 1).toString(); @@ -111,8 +123,7 @@ public class TeetimeConfiguration extends Configuration { final Distributor<Trigger> distributor = new Distributor<>(new CopyByReferenceStrategy()); final ModelSerializerStage executionModelSerializerStage = new ModelSerializerStage(typeModel, assemblyModel, - deploymentModel, executionModel, statisticsModel, parameterConfiguration.getPrefix(), - parameterConfiguration.getOutputFile()); + deploymentModel, executionModel, statisticsModel, parameterConfiguration.getOutputFile()); final DependencyGraphCreatorStage operationDependencyGraphCreatorStage = new DependencyGraphCreatorStage( executionModel, statisticsModel, new AssemblyLevelOperationDependencyGraphBuilderFactory()); diff --git a/tools/rewrite-log-entries/src/main/java/org/oceandsl/log/rewriter/TeetimeConfiguration.java b/tools/rewrite-log-entries/src/main/java/org/oceandsl/log/rewriter/TeetimeConfiguration.java index 4c9dac5597735681cc95b2a6bd8a233d454b311a..a17d771943e864c565f922ba180e50aaa5a66f0b 100644 --- a/tools/rewrite-log-entries/src/main/java/org/oceandsl/log/rewriter/TeetimeConfiguration.java +++ b/tools/rewrite-log-entries/src/main/java/org/oceandsl/log/rewriter/TeetimeConfiguration.java @@ -1,5 +1,5 @@ /** - * + * */ package org.oceandsl.log.rewriter; @@ -17,56 +17,57 @@ import teetime.framework.Configuration; */ public class TeetimeConfiguration extends Configuration { - public TeetimeConfiguration(LogRewriterSettings parameterConfiguration) throws IOException { - - kieker.common.configuration.Configuration configuration = new kieker.common.configuration.Configuration(); - configuration.setProperty(LogsReaderCompositeStage.LOG_DIRECTORIES, - parameterConfiguration.getInputFile().getCanonicalPath()); - configuration.setProperty("kieker.monitoring.name", "KIEKER"); - configuration.setProperty("kieker.monitoring.enabled","true"); - configuration.setProperty("kieker.monitoring.initialExperimentId","transcoded"); - configuration.setProperty("kieker.monitoring.metadata","true"); - configuration.setProperty("kieker.monitoring.setLoggingTimestamp","true"); - configuration.setProperty("kieker.monitoring.useShutdownHook","true"); - configuration.setProperty("kieker.monitoring.jmx","false"); - - configuration.setProperty("kieker.monitoring.timer", - kieker.monitoring.timer.SystemNanoTimer.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.timer.SystemMilliTimer.unit","0"); - configuration.setProperty("kieker.monitoring.timer.SystemNanoTimer.unit","0"); - configuration.setProperty("kieker.monitoring.writer", - kieker.monitoring.writer.filesystem.FileWriter.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.core.controller.WriterController.RecordQueueFQN", - org.jctools.queues.MpscArrayQueue.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.core.controller.WriterController.RecordQueueSize","10000"); - configuration.setProperty("kieker.monitoring.core.controller.WriterController.RecordQueueInsertBehavior","1"); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.customStoragePath",parameterConfiguration.getOutputFile().getCanonicalPath()); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.charsetName","UTF-8"); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.maxEntriesInFile","25000"); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.maxLogSize","-1"); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.maxLogFiles","-1"); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.mapFileHandler", - kieker.monitoring.writer.filesystem.TextMapFileHandler.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.writer.filesystem.TextMapFileHandler.flush","true"); - configuration.setProperty("kieker.monitoring.writer.filesystem.TextMapFileHandler.compression", - kieker.monitoring.writer.compression.NoneCompressionFilter.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.logFilePoolHandler", - kieker.monitoring.writer.filesystem.RotatingLogFilePoolHandler.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.logStreamHandler", - kieker.monitoring.writer.filesystem.TextLogStreamHandler.class.getCanonicalName()); - configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.flush","true"); - configuration.setProperty("kieker.monitoring.writer.filesystem.BinaryFileWriter.bufferSize","8192"); - configuration.setProperty("kieker.monitoring.writer.filesystem.BinaryFileWriter.compression", - kieker.monitoring.writer.compression.NoneCompressionFilter.class.getCanonicalName()); - - LogsReaderCompositeStage reader = new LogsReaderCompositeStage(configuration); - - RewriteBeforeAndAfterEventsStage processor = new RewriteBeforeAndAfterEventsStage(parameterConfiguration.getAddrlineExecutable(), - parameterConfiguration.getModelExecutable()); - - DataSinkStage writer = new DataSinkStage(configuration); - - this.connectPorts(reader.getOutputPort(), processor.getInputPort()); - this.connectPorts(processor.getOutputPort(), writer.getInputPort()); - } + public TeetimeConfiguration(final LogRewriterSettings parameterConfiguration) throws IOException { + + final kieker.common.configuration.Configuration configuration = new kieker.common.configuration.Configuration(); + configuration.setProperty(LogsReaderCompositeStage.LOG_DIRECTORIES, + parameterConfiguration.getInputFile().getCanonicalPath()); + configuration.setProperty("kieker.monitoring.name", "KIEKER"); + configuration.setProperty("kieker.monitoring.enabled", "true"); + configuration.setProperty("kieker.monitoring.initialExperimentId", "transcoded"); + configuration.setProperty("kieker.monitoring.metadata", "true"); + configuration.setProperty("kieker.monitoring.setLoggingTimestamp", "true"); + configuration.setProperty("kieker.monitoring.useShutdownHook", "true"); + configuration.setProperty("kieker.monitoring.jmx", "false"); + + configuration.setProperty("kieker.monitoring.timer", + kieker.monitoring.timer.SystemNanoTimer.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.timer.SystemMilliTimer.unit", "0"); + configuration.setProperty("kieker.monitoring.timer.SystemNanoTimer.unit", "0"); + configuration.setProperty("kieker.monitoring.writer", + kieker.monitoring.writer.filesystem.FileWriter.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.core.controller.WriterController.RecordQueueFQN", + org.jctools.queues.MpscArrayQueue.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.core.controller.WriterController.RecordQueueSize", "10000"); + configuration.setProperty("kieker.monitoring.core.controller.WriterController.RecordQueueInsertBehavior", "1"); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.customStoragePath", + parameterConfiguration.getOutputFile().getCanonicalPath()); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.charsetName", "UTF-8"); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.maxEntriesInFile", "25000"); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.maxLogSize", "-1"); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.maxLogFiles", "-1"); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.mapFileHandler", + kieker.monitoring.writer.filesystem.TextMapFileHandler.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.writer.filesystem.TextMapFileHandler.flush", "true"); + configuration.setProperty("kieker.monitoring.writer.filesystem.TextMapFileHandler.compression", + kieker.monitoring.writer.compression.NoneCompressionFilter.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.logFilePoolHandler", + kieker.monitoring.writer.filesystem.RotatingLogFilePoolHandler.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.logStreamHandler", + kieker.monitoring.writer.filesystem.TextLogStreamHandler.class.getCanonicalName()); + configuration.setProperty("kieker.monitoring.writer.filesystem.FileWriter.flush", "true"); + configuration.setProperty("kieker.monitoring.writer.filesystem.BinaryFileWriter.bufferSize", "8192"); + configuration.setProperty("kieker.monitoring.writer.filesystem.BinaryFileWriter.compression", + kieker.monitoring.writer.compression.NoneCompressionFilter.class.getCanonicalName()); + + final LogsReaderCompositeStage reader = new LogsReaderCompositeStage(configuration); + + final RewriteBeforeAndAfterEventsStage processor = new RewriteBeforeAndAfterEventsStage( + parameterConfiguration.getAddrlineExecutable(), parameterConfiguration.getModelExecutable(), ""); + + final DataSinkStage writer = new DataSinkStage(configuration); + + this.connectPorts(reader.getOutputPort(), processor.getInputPort()); + this.connectPorts(processor.getOutputPort(), writer.getInputPort()); + } }