@Test @Ignore public void exampleRecorder() throws Exception { PerfMark.setEnabled(true); PerfMark.startTask(this, s -> s.getClass().getSimpleName() + ".this"); PerfMark.stopTask(); PerfMark.startTask(this, s -> s.getClass().getSimpleName() + ".that"); PerfMark.stopTask(); PerfMark.startTask(this, s -> s.getClass().getSimpleName() + "::hi"); PerfMark.stopTask(); PerfMark.startTask(this, s -> s.getClass().getSimpleName() + "::hey"); PerfMark.stopTask(); PerfMark.startTask(this, s -> s.getClass().getSimpleName() + "::hey"); PerfMark.stopTask(); PerfMark.setEnabled(false); TraceEventViewer.writeTraceHtml(); }
@CanIgnoreReturnValue public static Path writeTraceHtml() throws IOException { Path path = Files.createTempFile("perfmark-trace-", ".html"); try (OutputStream os = Files.newOutputStream(path, TRUNCATE_EXISTING); Writer w = new OutputStreamWriter(os, UTF_8)) { writeTraceHtml(w); } logger.log(Level.INFO, "Wrote PerfMark Trace file: return path; }
TraceEventViewer { @CanIgnoreReturnValue public static Path writeTraceHtml() throws IOException { Path path = Files.createTempFile("perfmark-trace-", ".html"); try (OutputStream os = Files.newOutputStream(path, TRUNCATE_EXISTING); Writer w = new OutputStreamWriter(os, UTF_8)) { writeTraceHtml(w); } logger.log(Level.INFO, "Wrote PerfMark Trace file: return path; } }
TraceEventViewer { @CanIgnoreReturnValue public static Path writeTraceHtml() throws IOException { Path path = Files.createTempFile("perfmark-trace-", ".html"); try (OutputStream os = Files.newOutputStream(path, TRUNCATE_EXISTING); Writer w = new OutputStreamWriter(os, UTF_8)) { writeTraceHtml(w); } logger.log(Level.INFO, "Wrote PerfMark Trace file: return path; } private  TraceEventViewer(); }
TraceEventViewer { @CanIgnoreReturnValue public static Path writeTraceHtml() throws IOException { Path path = Files.createTempFile("perfmark-trace-", ".html"); try (OutputStream os = Files.newOutputStream(path, TRUNCATE_EXISTING); Writer w = new OutputStreamWriter(os, UTF_8)) { writeTraceHtml(w); } logger.log(Level.INFO, "Wrote PerfMark Trace file: return path; } private  TraceEventViewer(); @CanIgnoreReturnValue static Path writeTraceHtml(); static void writeTraceHtml(Writer writer); }
TraceEventViewer { @CanIgnoreReturnValue public static Path writeTraceHtml() throws IOException { Path path = Files.createTempFile("perfmark-trace-", ".html"); try (OutputStream os = Files.newOutputStream(path, TRUNCATE_EXISTING); Writer w = new OutputStreamWriter(os, UTF_8)) { writeTraceHtml(w); } logger.log(Level.INFO, "Wrote PerfMark Trace file: return path; } private  TraceEventViewer(); @CanIgnoreReturnValue static Path writeTraceHtml(); static void writeTraceHtml(Writer writer);  }