bric3 / fireplace

Flamegraph (Iciclegraph) swing component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java CI with Gradle Maven Central

Flamegraph / Iciclegraph Java Swing component

Shows a flamegraph in either light or dark mode

This flamegraph component is known to be used in JDK Mission Control 9.0 and in the Datadog plugin for IntelliJ.

Usage

Example usage
var fg = new FlamegraphView<Node>();

flamegraphView.setRenderConfiguration(
        FrameTextsProvider.of(
                frame -> frame.isRoot() ? "root" : frame.actualNode.getFrame().getHumanReadableShortString(),
                frame -> frame.isRoot() ? "" : FormatToolkit.getHumanReadable(frame.actualNode.getFrame().getMethod(), false, false, false, false, true, false),
                frame -> frame.isRoot() ? "" : frame.actualNode.getFrame().getMethod().getMethodName()
        ),
        new DimmingFrameColorProvider<>(defaultFrameColorMode.colorMapperUsing(ColorMapper.ofObjectHashUsing(defaultColorPalette.colors()))),
        FrameFontProvider.defaultFontProvider()
);

jpanel.add(flamegraphView.component);


// later, fill in the data
var listOfFrames = FrameBox.flattenAndCalculateCoordinate(new ArrayList<Node>(), ...);
flamegraphView.setModel(
        new FrameModel<>(
                "title, events (CPU, Locks)", // used in the root "frame"
                 (a, b) -> Objects.equals(a, b), // used to identify equal frames
                 listOfFrames
        )
);

About

Flamegraph (Iciclegraph) swing component

License:Mozilla Public License 2.0


Languages

Language:Java 67.1%Language:Kotlin 32.9%