private void printComponent(final DeployedComponent component) { final String name = component.getAssemblyComponent().getComponentType().getSignature(); this.printStream.println(INSERTION + name); }
@Override public void extract(final ComponentType componentType) { // BETTER code clean up, copied from old kieker analysis final String signature = componentType.getSignature(); final String packageName; final String name; if (signature.indexOf('.') != -1) { final String tmpComponentName = signature; int index = 0; for (index = tmpComponentName.length() - 1; index > 0; index--) { if (tmpComponentName.charAt(index) == '.') { break; } } packageName = tmpComponentName.substring(0, index); name = tmpComponentName.substring(index + 1); } else { packageName = ""; name = signature; } componentType.setName(name); componentType.setPackage(packageName); }
private void printHotspots() { final Map<OperationCall, Duration> sortedMap = HotspotDetectionStage.sortMapByValue(this.durationsWithoutChild); sortedMap.entrySet().stream().limit(this.maxOutput).map( e -> e.getKey().getOperation().getComponent().getAssemblyComponent().getComponentType().getSignature() + " " + e.getKey().getOperation().getAssemblyOperation().getOperationType().getSignature() + ": " + e.getValue().toString()) .forEach(this.printStream::println); }
/** * 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)); }