private ComponentType buildComponentTypeBySiganture(final String signature) { final ComponentType componentType = TypeFactory.eINSTANCE.createComponentType(); componentType.setSignature(signature); return componentType; }
private OperationType buildOperationTypeBySiganture(final String signature) { final OperationType operationType = TypeFactory.eINSTANCE.createOperationType(); operationType.setSignature(signature); return operationType; }
public StaticModelsAssemblerStage(final SignatureExtractor signatureExtractor) { this(TypeFactory.eINSTANCE.createTypeModel(), AssemblyFactory.eINSTANCE.createAssemblyModel(), DeploymentFactory.eINSTANCE.createDeploymentModel(), signatureExtractor); }
/** * Test method for {@link kieker.analysisteetime.model.TypeModelAssembler#addRecord(kieker.common.record.flow.IOperationRecord)}. */ @Test public void testComponentsExistsAfterAddRecordFromRecord() { final TypeModel typeModel = this.factory.createTypeModel(); final TypeModelAssembler typeModelAssembler = new TypeModelAssembler(typeModel, new JavaComponentSignatureExtractor(), new JavaOperationSignatureExtractor()); typeModelAssembler.addRecord(this.beforeOperationEvent1); typeModelAssembler.addRecord(this.beforeOperationEvent2); typeModelAssembler.addRecord(this.beforeOperationEvent3); final List<String> actualList = typeModel.getComponentTypes().values().stream().map(c -> c.getSignature()).collect(Collectors.toList()); final List<String> expectedList = Arrays.asList(EXAMPLE_CLASS_SIGNATURE_1, EXAMPLE_CLASS_SIGNATURE_2); Collections.sort(actualList); Collections.sort(expectedList); Assert.assertTrue(actualList.equals(expectedList)); }
private OperationType addOperationType(final ComponentType componentType, final String operationSignature) { final String operationTypeKey = operationSignature; OperationType operationType = componentType.getProvidedOperations().get(operationSignature); if (operationType == null) { operationType = this.factory.createOperationType(); operationType.setSignature(operationSignature); this.operationSignatureExtractor.extract(operationType); componentType.getProvidedOperations().put(operationTypeKey, operationType); } return operationType; }
private ComponentType addComponentType(final String componentSignature) { final String componentTypeKey = componentSignature; ComponentType componentType = this.typeModel.getComponentTypes().get(componentTypeKey); if (componentType == null) { componentType = this.factory.createComponentType(); componentType.setSignature(componentSignature); this.componentSignatureExtractor.extract(componentType); this.typeModel.getComponentTypes().put(componentTypeKey, componentType); } return componentType; }
/** * Test method for {@link kieker.analysisteetime.model.TypeModelAssembler#addRecord(java.lang.String, java.lang.String)}. */ @Test public void testOperationExistsAfterAddRecordFromString() { final TypeModel typeModel = this.factory.createTypeModel(); final TypeModelAssembler typeModelAssembler = new TypeModelAssembler(typeModel, new JavaComponentSignatureExtractor(), new JavaOperationSignatureExtractor()); typeModelAssembler.addRecord(EXAMPLE_CLASS_SIGNATURE_1, EXAMPLE_OPERATION_SIGNATURE_1); typeModelAssembler.addRecord(EXAMPLE_CLASS_SIGNATURE_1, EXAMPLE_OPERATION_SIGNATURE_2); typeModelAssembler.addRecord(EXAMPLE_CLASS_SIGNATURE_2, EXAMPLE_OPERATION_SIGNATURE_3); final List<String> actualList = typeModel.getComponentTypes().get(EXAMPLE_CLASS_SIGNATURE_1).getProvidedOperations().values().stream() .map(c -> c.getSignature()).collect(Collectors.toList()); final List<String> expectedList = Arrays.asList(EXAMPLE_OPERATION_SIGNATURE_1, EXAMPLE_OPERATION_SIGNATURE_2); Collections.sort(actualList); Collections.sort(expectedList); Assert.assertTrue(actualList.equals(expectedList)); }
/** * Test method for {@link kieker.analysisteetime.model.TypeModelAssembler#addRecord(kieker.common.record.flow.IOperationRecord)}. */ @Test public void testOperationExistsAfterAddRecordFromRecord() { final TypeModel typeModel = this.factory.createTypeModel(); final TypeModelAssembler typeModelAssembler = new TypeModelAssembler(typeModel, new JavaComponentSignatureExtractor(), new JavaOperationSignatureExtractor()); typeModelAssembler.addRecord(this.beforeOperationEvent1); typeModelAssembler.addRecord(this.beforeOperationEvent2); typeModelAssembler.addRecord(this.beforeOperationEvent3); final List<String> actualList = typeModel.getComponentTypes().get(EXAMPLE_CLASS_SIGNATURE_1).getProvidedOperations().values().stream() .map(c -> c.getSignature()).collect(Collectors.toList()); final List<String> expectedList = Arrays.asList(EXAMPLE_OPERATION_SIGNATURE_1, EXAMPLE_OPERATION_SIGNATURE_2); Collections.sort(actualList); Collections.sort(expectedList); Assert.assertTrue(actualList.equals(expectedList)); }
/** * Test method for {@link kieker.analysisteetime.model.TypeModelAssembler#addRecord(kieker.common.record.flow.IOperationRecord)}. */ @Test public void testComponentKeysExistsAfterAddRecordFromRecord() { final TypeModel typeModel = this.factory.createTypeModel(); final TypeModelAssembler typeModelAssembler = new TypeModelAssembler(typeModel, new JavaComponentSignatureExtractor(), new JavaOperationSignatureExtractor()); typeModelAssembler.addRecord(this.beforeOperationEvent1); typeModelAssembler.addRecord(this.beforeOperationEvent2); typeModelAssembler.addRecord(this.beforeOperationEvent3); final List<String> actualList = new ArrayList<>(typeModel.getComponentTypes().keySet()); final List<String> expectedList = Arrays.asList(EXAMPLE_CLASS_SIGNATURE_1, EXAMPLE_CLASS_SIGNATURE_2); Collections.sort(actualList); Collections.sort(expectedList); Assert.assertTrue(actualList.equals(expectedList)); }
/** * Test method for {@link kieker.analysisteetime.model.TypeModelAssembler#addRecord(kieker.common.record.flow.IOperationRecord)}. */ @Test public void testOperationKeysExistsAfterAddRecordFromRecord() { final TypeModel typeModel = this.factory.createTypeModel(); final TypeModelAssembler typeModelAssembler = new TypeModelAssembler(typeModel, new JavaComponentSignatureExtractor(), new JavaOperationSignatureExtractor()); typeModelAssembler.addRecord(this.beforeOperationEvent1); typeModelAssembler.addRecord(this.beforeOperationEvent2); typeModelAssembler.addRecord(this.beforeOperationEvent3); final List<String> actualList = new ArrayList<>(typeModel.getComponentTypes().get(EXAMPLE_CLASS_SIGNATURE_1).getProvidedOperations().keySet()); final List<String> expectedList = Arrays.asList(EXAMPLE_OPERATION_SIGNATURE_1, EXAMPLE_OPERATION_SIGNATURE_2); Collections.sort(actualList); Collections.sort(expectedList); Assert.assertTrue(actualList.equals(expectedList)); }
public HotspotDetectionConfiguration(final File importDirectory) { final TypeModel typeModel = TypeFactory.eINSTANCE.createTypeModel(); final AssemblyModel assemblyModel = AssemblyFactory.eINSTANCE.createAssemblyModel(); final DeploymentModel deploymentModel = DeploymentFactory.eINSTANCE.createDeploymentModel(); // Create the stages final ReadingComposite reader = new ReadingComposite(importDirectory); // BETTER consider if KiekerMetadataRecord has to be processed // final AllowedRecordsFilter allowedRecordsFilter = new AllowedRecordsFilter(); final InstanceOfFilter<IMonitoringRecord, IFlowRecord> instanceOfFilter = new InstanceOfFilter<>(IFlowRecord.class); final TypeModelAssemblerStage typeModelAssembler = new TypeModelAssemblerStage(typeModel, new JavaComponentSignatureExtractor(), new JavaOperationSignatureExtractor()); final AssemblyModelAssemblerStage assemblyModelAssembler = new AssemblyModelAssemblerStage(typeModel, assemblyModel); final DeploymentModelAssemblerStage deploymentModelAssembler = new DeploymentModelAssemblerStage(assemblyModel, deploymentModel); final TraceReconstructorStage traceReconstructor = new TraceReconstructorStage(deploymentModel, ChronoUnit.NANOS); final HotspotDetectionStage hotspotDetector = new HotspotDetectionStage(); // Connect the stages super.connectPorts(reader.getOutputPort(), instanceOfFilter.getInputPort()); super.connectPorts(instanceOfFilter.getMatchedOutputPort(), typeModelAssembler.getInputPort()); super.connectPorts(typeModelAssembler.getOutputPort(), assemblyModelAssembler.getInputPort()); super.connectPorts(assemblyModelAssembler.getOutputPort(), deploymentModelAssembler.getInputPort()); super.connectPorts(deploymentModelAssembler.getOutputPort(), traceReconstructor.getInputPort()); super.connectPorts(traceReconstructor.getOutputPort(), hotspotDetector.getInputPort()); }