@Test public void testWriteRuntimeDependencies() throws IOException { final ByteArrayOutputStream output = new ByteArrayOutputStream(); final Counter sqlCounter = new Counter("sql", null); final Counter counter = new Counter("services", null, sqlCounter); counter.bindContextIncludingCpu("BeanA.test"); counter.bindContextIncludingCpu("BeanA.test2"); counter.bindContextIncludingCpu("BeanB.test"); counter.addRequestForCurrentContext(false); counter.bindContextIncludingCpu("BeanB.test2"); counter.addRequestForCurrentContext(false); counter.addRequestForCurrentContext(false); counter.addRequestForCurrentContext(false); counter.bindContextIncludingCpu("test"); counter.bindContextIncludingCpu("BeanA.test"); counter.addRequestForCurrentContext(false); counter.addRequestForCurrentContext(false); counter.bindContextIncludingCpu("test2"); sqlCounter.bindContextIncludingCpu("sql"); sqlCounter.addRequestForCurrentContext(false); counter.addRequestForCurrentContext(false); final PdfOtherReport pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeRuntimeDependencies(counter, Period.TOUT.getRange()); assertNotEmptyAndClear(output); }
public void writeRuntimeDependencies(Counter counter, Range range) throws IOException { try { final Document myDocument = pdfDocumentFactory.createDocument(true); myDocument.open(); final String counterLabel = getString(counter.getName() + "Label"); final String paragraphTitle = getFormattedString("Dependance_compteur", counterLabel) + " - " + range.getLabel(); myDocument.add(pdfDocumentFactory.createParagraphElement(paragraphTitle, counter.getIconName())); new PdfRuntimeDependenciesReport(counter, myDocument).toPdf(); myDocument.close(); } catch (final DocumentException e) { throw createIOException(e); } }
PdfOtherReport { public void writeRuntimeDependencies(Counter counter, Range range) throws IOException { try { final Document myDocument = pdfDocumentFactory.createDocument(true); myDocument.open(); final String counterLabel = getString(counter.getName() + "Label"); final String paragraphTitle = getFormattedString("Dependance_compteur", counterLabel) + " - " + range.getLabel(); myDocument.add(pdfDocumentFactory.createParagraphElement(paragraphTitle, counter.getIconName())); new PdfRuntimeDependenciesReport(counter, myDocument).toPdf(); myDocument.close(); } catch (final DocumentException e) { throw createIOException(e); } } }
PdfOtherReport { public void writeRuntimeDependencies(Counter counter, Range range) throws IOException { try { final Document myDocument = pdfDocumentFactory.createDocument(true); myDocument.open(); final String counterLabel = getString(counter.getName() + "Label"); final String paragraphTitle = getFormattedString("Dependance_compteur", counterLabel) + " - " + range.getLabel(); myDocument.add(pdfDocumentFactory.createParagraphElement(paragraphTitle, counter.getIconName())); new PdfRuntimeDependenciesReport(counter, myDocument).toPdf(); myDocument.close(); } catch (final DocumentException e) { throw createIOException(e); } } PdfOtherReport(String application, OutputStream output); }
PdfOtherReport { public void writeRuntimeDependencies(Counter counter, Range range) throws IOException { try { final Document myDocument = pdfDocumentFactory.createDocument(true); myDocument.open(); final String counterLabel = getString(counter.getName() + "Label"); final String paragraphTitle = getFormattedString("Dependance_compteur", counterLabel) + " - " + range.getLabel(); myDocument.add(pdfDocumentFactory.createParagraphElement(paragraphTitle, counter.getIconName())); new PdfRuntimeDependenciesReport(counter, myDocument).toPdf(); myDocument.close(); } catch (final DocumentException e) { throw createIOException(e); } } PdfOtherReport(String application, OutputStream output); void close(); void writeSessionInformations(List<SessionInformations> sessionsInformations); void writeHeapHistogram(HeapHistogram heapHistogram); void writeHotspots(List<SampledMethod> hotspots); void writeProcessInformations(List<ProcessInformations> processInformations); void writeProcessInformations(
			Map<String, List<ProcessInformations>> processInformationsByTitle); void writeDatabaseInformations(DatabaseInformations databaseInformations); void writeJndi(List<JndiBinding> jndiBindings, String path); void writeMBeans(List<MBeanNode> mbeans); void writeMBeans(Map<String, List<MBeanNode>> mbeansByTitle); void writeAllCurrentRequestsAsPart(
			Map<JavaInformations, List<CounterRequestContext>> currentRequests, Collector collector,
			List<Counter> counters, long timeOfSnapshot); void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer,
			Range range, String requestId); void writeRuntimeDependencies(Counter counter, Range range); void writeCounterSummaryPerClass(Collector collector, Counter counter, String requestId,
			Range range); void writeThreads(List<JavaInformations> javaInformationsList); }
PdfOtherReport { public void writeRuntimeDependencies(Counter counter, Range range) throws IOException { try { final Document myDocument = pdfDocumentFactory.createDocument(true); myDocument.open(); final String counterLabel = getString(counter.getName() + "Label"); final String paragraphTitle = getFormattedString("Dependance_compteur", counterLabel) + " - " + range.getLabel(); myDocument.add(pdfDocumentFactory.createParagraphElement(paragraphTitle, counter.getIconName())); new PdfRuntimeDependenciesReport(counter, myDocument).toPdf(); myDocument.close(); } catch (final DocumentException e) { throw createIOException(e); } } PdfOtherReport(String application, OutputStream output); void close(); void writeSessionInformations(List<SessionInformations> sessionsInformations); void writeHeapHistogram(HeapHistogram heapHistogram); void writeHotspots(List<SampledMethod> hotspots); void writeProcessInformations(List<ProcessInformations> processInformations); void writeProcessInformations(
			Map<String, List<ProcessInformations>> processInformationsByTitle); void writeDatabaseInformations(DatabaseInformations databaseInformations); void writeJndi(List<JndiBinding> jndiBindings, String path); void writeMBeans(List<MBeanNode> mbeans); void writeMBeans(Map<String, List<MBeanNode>> mbeansByTitle); void writeAllCurrentRequestsAsPart(
			Map<JavaInformations, List<CounterRequestContext>> currentRequests, Collector collector,
			List<Counter> counters, long timeOfSnapshot); void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer,
			Range range, String requestId); void writeRuntimeDependencies(Counter counter, Range range); void writeCounterSummaryPerClass(Collector collector, Counter counter, String requestId,
			Range range); void writeThreads(List<JavaInformations> javaInformationsList);  }