@Test public void testWriteRequestAndGraphDetail() throws IOException { final Counter sqlCounter = new Counter("sql", "db.png"); final Counter httpCounter = new Counter("http", "db.png", sqlCounter); final Counter errorCounter = new Counter("error", "db.png"); final List<Counter> counters = new ArrayList<Counter>(); counters.add(httpCounter); counters.add(sqlCounter); counters.add(errorCounter); final Collector collector = new Collector("test", counters); final JavaInformations javaInformations = new JavaInformations(null, true); httpCounter.bindContext("test 1", "complete test 1", null, -1, -1); sqlCounter.bindContext("sql1", "sql 1", null, -1, -1); sqlCounter.addRequest("sql1", 100, 100, 100, false, -1); httpCounter.addRequest("test 1", 0, 0, 0, false, 1000); errorCounter.addRequestForSystemError("test error", 0, 0, 0, " a stack-trace"); collector.collectWithoutErrors(Arrays.asList(javaInformations)); final String requestId = httpCounter.getRequests().get(0).getId(); final String requestId2 = errorCounter.getRequests().get(0).getId(); final ByteArrayOutputStream output = new ByteArrayOutputStream(); final PdfOtherReport pdfOtherReport = new PdfOtherReport(TEST_APP, output); pdfOtherReport.writeRequestAndGraphDetail(collector, null, Period.TOUT.getRange(), requestId); assertNotEmptyAndClear(output); final PdfOtherReport pdfOtherReport2 = new PdfOtherReport(TEST_APP, output); pdfOtherReport2.writeRequestAndGraphDetail(collector, null, Period.TOUT.getRange(), requestId2); assertNotEmptyAndClear(output); JRobin.initBackendFactory(new Timer(getClass().getSimpleName(), true)); final String graphName = "usedMemory"; final PdfOtherReport pdfOtherReport3 = new PdfOtherReport(TEST_APP, output); pdfOtherReport3.writeRequestAndGraphDetail(collector, null, Period.TOUT.getRange(), graphName); assertNotEmptyAndClear(output); }
public void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer, Range range, String requestId) throws IOException { try { document.open(); new PdfRequestAndGraphDetailReport(collector, collectorServer, range, requestId, pdfDocumentFactory, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
PdfOtherReport { public void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer, Range range, String requestId) throws IOException { try { document.open(); new PdfRequestAndGraphDetailReport(collector, collectorServer, range, requestId, pdfDocumentFactory, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); } }
PdfOtherReport { public void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer, Range range, String requestId) throws IOException { try { document.open(); new PdfRequestAndGraphDetailReport(collector, collectorServer, range, requestId, pdfDocumentFactory, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); } PdfOtherReport(String application, OutputStream output); }
PdfOtherReport { public void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer, Range range, String requestId) throws IOException { try { document.open(); new PdfRequestAndGraphDetailReport(collector, collectorServer, range, requestId, pdfDocumentFactory, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); } 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 writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer, Range range, String requestId) throws IOException { try { document.open(); new PdfRequestAndGraphDetailReport(collector, collectorServer, range, requestId, pdfDocumentFactory, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); } 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);  }