Package io.perfmark.traceviewer
Class TraceEventViewer
java.lang.Object
io.perfmark.traceviewer.TraceEventViewer
This class converts from the Trace Event json data into a full HTML page. It includes the trace
viewer from Catapult, the Chromium trace UI.
This class is separate from TraceEventWriter, because it includes a fairly large HTML
chunk, and brings in a differently licenced piece of code.
This code is NOT API stable, and may be removed in the future, or changed without notice.
- Since:
- 0.17.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringreadAll(InputStream stream) private static StringreplaceIndexTraceData(String index, String replacement) private static StringreplaceIndexTraceImport(String index, String replacement, String inlineTraceData64) Replaces the normal<link>tag in index.html with a custom replacement, and optionally the inlined Trace data as a base64 script.private static StringreplaceIndexWebComponents(String index, String replacement) private static StringtrimTraceViewer(String traceViewer) static PathA convenience function aroundwriteTraceHtml(Writer).static voidwriteTraceHtml(Writer writer) Writes all available trace data as a single HTML file into the given writer.
-
Field Details
-
logger
-
INLINE_TRACE_DATA
- See Also:
-
-
Constructor Details
-
TraceEventViewer
private TraceEventViewer()
-
-
Method Details
-
writeTraceHtml
A convenience function aroundwriteTraceHtml(Writer). This writes the trace data to a temporary file and logs the output location.- Returns:
- the Path of the written file.
- Throws:
IOException- if it can't write to the destination.
-
writeTraceHtml
Writes all available trace data as a single HTML file into the given writer.- Parameters:
writer- The destination to write all HTML to.- Throws:
IOException- if it can't write to the writer.
-
replaceIndexTraceImport
private static String replaceIndexTraceImport(String index, String replacement, String inlineTraceData64) Replaces the normal<link>tag in index.html with a custom replacement, and optionally the inlined Trace data as a base64 script. This is because the trace2html.html file imports the data as a top level text/plain script. -
replaceIndexWebComponents
-
replaceIndexTraceData
-
trimTraceViewer
-
readAll
- Throws:
IOException
-