https://github.com/bric3/fireplace
Flamegraph (Iciclegraph) swing component
https://github.com/bric3/fireplace
flamegraph iciclegraph java jfr swing
Last synced: about 2 months ago
JSON representation
Flamegraph (Iciclegraph) swing component
- Host: GitHub
- URL: https://github.com/bric3/fireplace
- Owner: bric3
- License: mpl-2.0
- Created: 2022-01-03T10:37:54.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-08T10:33:06.000Z (11 months ago)
- Last Synced: 2025-04-08T10:34:06.934Z (11 months ago)
- Topics: flamegraph, iciclegraph, java, jfr, swing
- Language: Java
- Homepage:
- Size: 18 MB
- Stars: 18
- Watchers: 3
- Forks: 5
- Open Issues: 19
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
image:https://github.com/bric3/fireplace/actions/workflows/build.yml/badge.svg[Java CI with Gradle,link=https://github.com/bric3/fireplace/actions/workflows/build.yml]
// image:https://snyk.io/test/github/bric3/fireplace/badge.svg?targetFile=build.gradle["Known Vulnerabilities", link="https://snyk.io/test/github/bric3/fireplace?targetFile=build.gradle.kts"]
image:https://img.shields.io/maven-central/v/io.github.bric3.fireplace/fireplace-swing.svg["Maven Central", link="https://search.maven.org/artifact/io.github.bric3.fireplace/fireplace-swing"]
image:https://img.shields.io/github/release/bric3/fireplace.svg?label=Github%20Release[Github Release,link=https://github.com/bric3/fireplace/releases/latest]
image:https://img.shields.io/github/license/bric3/fireplace.svg[License]
== Flamegraph / Iciclegraph Java Swing component
++++

++++
This flamegraph component is known to be used in https://github.com/openjdk/jmc[JDK Mission Control 9.0] and in the https://docs.datadoghq.com/developers/ide_integrations/idea/[Datadog plugin for IntelliJ].
== Usage
.Example usage
[source,java]
----
var flamegraphView = new FlamegraphView();
flamegraphView.setFrameRender(
new DefaultFrameRenderer<>(
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(), ...);
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
)
);
----
Earlier builds used to set up the view using `setRenderConfiguration`, this is deprecated for removal and code should
be migrated to use `setFrameRender` instead.
== Configuration Options
[cols="1,2,1"]
|===
|Method |Description |Default
|`setMode(Mode)`
|Display mode: `FLAMEGRAPH` (root at bottom) or `ICICLEGRAPH` (root at top)
|`ICICLEGRAPH`
|`setFrameClickAction(FrameClickAction)`
|Click behavior: `FOCUS_FRAME` (double-click zooms) or `EXPAND_FRAME` (single-click expands)
|`FOCUS_FRAME`
|`setShowMinimap(boolean)`
|Show/hide the navigation minimap
|`true`
|`setShowHoveredSiblings(boolean)`
|Highlight identical frames elsewhere in the graph on hover
|`true`
|`setTooltipTextFunction(BiFunction)`
|Customize tooltip text for frames
|—
|`setPopupConsumer(BiConsumer)`
|Handle right-click context menu on frames
|—
|`setSelectedFrameConsumer(BiConsumer)`
|Callback when a frame is selected (single-click)
|—
|`setHoverListener(HoverListener)`
|Listen for frame hover events
|—
|`highlightFrames(Set, String)`
|Highlight frames matching a search
|—
|===
== Exporting to Image
Use `FlamegraphImage` to render a flamegraph to a static image (e.g., for export or reports).
== Misc
Snapshot versions will be delivered at
> Maven Central Portal: https://central.sonatype.com/repository/maven-snapshots/[https://s01.oss.sonatype.org/content/repositories/*snapshots*/io/github/bric3/fireplace]