All Projects → flamegrapher → flamegrapher

flamegrapher / flamegrapher

Licence: Apache-2.0 License
Web frontend and REST API for Java Flight Recorder with Flamegraphs 🔥

Programming Languages

java
68154 projects - #9 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to flamegrapher

flight-recorder-starter
This is a Spring Boot 2 Starter exposing the JDK Flight Recorder as a Spring Boot Actuator Endpoint.
Stars: ✭ 20 (-74.03%)
Mutual labels:  flamegraph, java-flight-recorder, java-mission-control
doc
QuickPerf documentation: https://github.com/quick-perf/doc/wiki/QuickPerf
Stars: ✭ 22 (-71.43%)
Mutual labels:  jvm, java-flight-recorder
wasm.cljc
Spec compliant WebAssembly compiler, decompiler, and generator
Stars: ✭ 178 (+131.17%)
Mutual labels:  jvm
delta
DDD-centric event-sourcing library for the JVM
Stars: ✭ 15 (-80.52%)
Mutual labels:  jvm
tribble
Coverage based JVM Fuzz testing tool.
Stars: ✭ 16 (-79.22%)
Mutual labels:  jvm
tools jvm autodeps
Automatic Dependency Management Tools for JVM Languages
Stars: ✭ 48 (-37.66%)
Mutual labels:  jvm
JavaInterview
JVM、JUC(高并发)、集合、计算机网络、数据库、MySql、Redis、、工作流(Activiti)、规则引擎(Drools)、Spring、SpringCloud、Mybatis、Git、Docker、Utils、Linux
Stars: ✭ 179 (+132.47%)
Mutual labels:  jvm
arquillian-graphene
Robust Functional Tests leveraging WebDriver with flavour of neat AJAX-ready API
Stars: ✭ 91 (+18.18%)
Mutual labels:  jvm
iokk
International Obfuscated Kotlin Contest
Stars: ✭ 56 (-27.27%)
Mutual labels:  jvm
hsdis-macos
macOS Build artifacts for hsdis HotSpot Plugin
Stars: ✭ 22 (-71.43%)
Mutual labels:  jvm
java-rust-ffi
🍋 FFI example for accessing Rust lang dynamic libraries from java
Stars: ✭ 37 (-51.95%)
Mutual labels:  jvm
Hephaistos
NBT & Anvil save format library
Stars: ✭ 22 (-71.43%)
Mutual labels:  jvm
FlameViewer
Tool for flamegraphs visualization
Stars: ✭ 76 (-1.3%)
Mutual labels:  flamegraph
graalvm
A Cloud Native Buildpack that provides the GraalVM implementations of JREs and JDKs
Stars: ✭ 21 (-72.73%)
Mutual labels:  jvm
LGP
A robust Linear Genetic Programming implementation on the JVM using Kotlin.
Stars: ✭ 14 (-81.82%)
Mutual labels:  jvm
probes-api
Software Activity Metering - Probes Open API
Stars: ✭ 31 (-59.74%)
Mutual labels:  jvm
jellyfin-sdk-kotlin
Kotlin SDK for Jellyfin, supporting Android and JVM Targets
Stars: ✭ 43 (-44.16%)
Mutual labels:  jvm
JavaResolver
Java class file inspection library for .NET.
Stars: ✭ 39 (-49.35%)
Mutual labels:  jvm
sherlock-distributed-lock
Distributed locking library for JVM
Stars: ✭ 17 (-77.92%)
Mutual labels:  jvm
Algorithm-Math
算法 & 数学知识 & 重拾基础知识系列文章编写和收集
Stars: ✭ 19 (-75.32%)
Mutual labels:  jvm

Flamegrapher 🔥

Flamegrapher is a frontend for the Java Flight Recorder that allows you to start, dump, stop, save (locally or on S3) and download a JFR recording from the browser. Flamegrapher allows you to generate flamegraphs out of the JFR recordings for methods on CPU, locks, exceptions and allocations.

Flamegrapher ships as a self-contained fat-jar. All you need to launch it is:

java -jar flamegrapher-1.0.0.jar

and then open your browser at http://localhost:8080/flames

flamegrapher home page

Once you capture some events, you will be able to dump your recording and generate the flamegraph without leaving the browser:

cpu flamegraph

Java Flight Recorder ships with Hotspot JVM (Oracle) starting from JDK 7. It's being open-sourced and should land on OpenJDK 11.

JFR is a commercial feature on Hotspot. It can be used for development without a license, but requires a license for production usage.

Features

  • List all JVMs compatible with JFR that are running on the same server;
  • Automatically unlock commercial features and start a recording;
  • Dump a JFR recording to disk;
  • Save a JFR recording to remote storage (S3);
  • Download remotely stored JFR recordings for opening it with Java Mission Control;
  • Generate CPU, exceptions, locks, allocations in new TLAB and allocations outside TLAB flamegraphs;
  • REST API.

How it works?

Flamegrapher stands on the shoulders of giants :)

It's based on Vertx, so it's lightweight. It can serve dynamic and static content all shipped on the same jar, while consuming few resources on the host (can be run with a small heap). It uses JCMD to control JFR recordings (start, stop, dump). JCMD is called from Java code using Vertx's child process extension. It saves to S3 using Vertx's S3 client.

Flamegraphs are generated using Java Mission Control JFR parser, as described by Marcus Hirt on his blog and displayed using Martin Spier's d3-flame-graph D3 plugin. Flamegrapher JSON writer was originally written by Isuru Perera in jfr-flame-graph. OSS FTW!

Finally, flamegraphs themselves were created by Brendan Gregg.

Configuration

Flamegrapher's configuration relies on Vertx configuration module. So, you can use a json configuration file, system variable or environment variables for configuration. All settings are optional, if S3 settings are not available you will not be able use the functionality. For everything else there are sensible defaults.

  • FLAMEGRAPHER_EPHEMERAL_PORT: If set to true listens on ephemeral port. Overrides FLAMEGRAHPER_HTTP_PORT;
  • FLAMEGRAPHER_HTTP_PORT: HTTP listening port. Defaults to "8080";
  • FLAMEGRAPHER_HTTP_SERVER: Network interface on which server listens. Defaults to "0.0.0.0" which means all interfaces;
  • FLAMEGRAPHER_S3_SERVER: S3 server URL;
  • FLAMEGRAPHER_S3_REGION: S3 region - defaults to us-east-1
  • FLAMEGRAPHER_S3_PORT: S3 port;
  • FLAMEGRAPHER_S3_ACCESS_KEY: Access key;
  • FLAMEGRAPHER_S3_SECRET_KEY: Secret key;
  • FLAMEGRAPHER_S3_DUMPS_BUCKET: S3 bucket for dumps. Defaults to "dumps";
  • FLAMEGRAPHER_S3_FLAMES_BUCKET: S3 bucket for flames. Defaults to "flames";
  • FLAMEGRAPHER_S3_DUMPS_PREFIX: Prefix for objects stored in the dumps bucket. Allows one bucket to be used for dumps and flames. Defaults to ""
  • FLAMEGRAPHER_S3_FLAMES_PREFIX: Prefix for objects stored in the flames bucket. Allows one bucket to be used for dumps and flames. Defaults to ""
  • FLAMEGRAPHER_JFR_DUMP_PATH: Base directory for saving JFR dumps locally. Defaults to "/tmp/flamegrapher";
  • JFR_SETTINGS_JDK9_PLUS: [Optional] Custom settings for JDK 9+;
  • JFR_SETTINGS_JDK7_OR_8: [Optional] Custom settings for JDK 7 or 8.

Building and launching Flamegrapher

For now, we don't distribute binaries for Flamegrapher, so you have to build it yourself. The idea is that in the future we'd be able to ship a binary using the newly open-sourced JMC APIs, but for now you'll need the following:

  • Oracle JDK 10+
  • Maven 3.x (tested with 3.5.3)
  • Git

Steps:

  • Clone this repository locally
  • Make sure you have the Oracle JDK 10+ set (you can check that with mvn -v)
  • Run the install-mc-jars.sh to get the JMC jars from your Oracle JDK installation (they're not yet available on Maven central yet). This script has been tested on Mac and Windows.
  • Run mvn clean package to build Flamegrapher
  • Your fat jar should be available under target/flamegrapher-[version].jar

Launching:

Assuming that you're in the same directory from where you built the jar, you can launch:

java -jar target/flamegrapher-[version].jar

To know more

We're doing a presentation at Riviera Dev and slides should be available soon. We will explain in more details how to read exceptions and locks flamegraphs, for example.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].