A Java diagnostic tool that lets you troubleshoot running JVM applications live, without code changes or restarts.
LinShunKang/MyPerf4J
A high-performance Java APM tool that collects method and JVM metrics via a Java agent, with no changes to application code.
- Stars
- 3,570
- Forks
- 551
- Open issues
- 6
- Last commit
- 3 months ago
What is it?
MyPerf4J is a Java application performance monitoring and statistics tool aimed at high-concurrency, low-latency services. It attaches to a JVM through a JavaAgent built on ASM bytecode instrumentation, so it can record method response times without changes to application code. Metrics include RPS, count, average, min, max, standard deviation and TP percentiles (TP50 through TP100) per method, along with JVM thread, memory, GC, class, compilation and file descriptor metrics.
Statistics are aggregated at a granularity of one second, and the project states that every call is counted rather than sampled. Results are written to log files, and the project provides configuration for shipping them to InfluxDB with Grafana dashboards. Setup uses a properties file and two JVM arguments; on JDK 9 and later an extra --add-opens flag is required.
The project is licensed under BSD-3-Clause and can also be built from source with Maven.
Key features
- 01Attaches via JavaAgent with no application code changes
- 02Per-method metrics including RPS, average, max, and TP50 to TP100 percentiles
- 03JVM metrics covering threads, memory, GC, classes, compilation and file descriptors
- 04One-second statistics granularity with every call recorded
- 05Output to log files, with InfluxDB and Grafana integration
Use cases
- Finding slow methods in a Java microservice under production load
- Monitoring JVM memory, GC and thread behavior over time
- Building Grafana dashboards for Java service performance
Quick start
- 1
Download and unzip MyPerf4J-ASM.zip, then edit MyPerf4J.properties
- 2
Add the Java agent and properties file to your JVM startup arguments
java -javaagent:/path/to/MyPerf4J-ASM.jar -DMyPerf4JPropFile=/path/to/MyPerf4J.properties -jar yourApp.jar - 3
Start the app and check /path/to/log/method_metrics.log for output
Things to know
- Setup requires editing a properties file and JVM startup flags.
- On JDK 9 and later, an extra --add-opens java.base/java.lang=ALL-UNNAMED flag is required.
In collections
Topics
FAQ
- What is MyPerf4J?
- A high-performance Java APM tool that collects method and JVM metrics via a Java agent, with no changes to application code. MyPerf4J is a Java application performance monitoring and statistics tool aimed at high-concurrency, low-latency services. It attaches to a JVM through a JavaAgent built on ASM bytecode instrumentation, so it can record method response times without changes to application code. Metrics include RPS, count, average, min, max, standard deviation and TP percentiles (TP50 through TP100) per method, along with JVM thread, memory, GC, class, compilation and file descriptor metrics.
- Is MyPerf4J free to use? What license does it have?
- MyPerf4J is open source under the BSD-3-Clause license. Check the license terms before using it in commercial products.
- Is MyPerf4J still maintained?
- Updated within 6 months. The last commit to MyPerf4J was on Jul 31, 2026.
- What can I use MyPerf4J for?
- Finding slow methods in a Java microservice under production load Monitoring JVM memory, GC and thread behavior over time Building Grafana dashboards for Java service performance
- How do I install MyPerf4J?
- Download and unzip MyPerf4J-ASM.zip, then edit MyPerf4J.properties Add the Java agent and properties file to your JVM startup arguments: java -javaagent:/path/to/MyPerf4J-ASM.jar -DMyPerf4JPropFile=/path/to/MyPerf4J.properties -jar yourApp.jar Start the app and check /path/to/log/method_metrics.log for output
- Where can I get MyPerf4J?
- The source code and installation instructions are on GitHub: https://github.com/LinShunKang/MyPerf4J
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A free Java code coverage library that measures which parts of Java bytecode are exercised by tests.
Datadog's official Go client library for APM tracing, continuous profiling, and application security monitoring.
A JVM sandbox container that adds non-invasive, runtime AOP to running Java applications without restarting them.
Low-overhead sampling profiler for Java that captures CPU, allocation, lock and native memory profiles without safepoint bias.
Zero-code observability for cloud-native and AI applications, using eBPF and Wasm to collect metrics, traces, request logs and profiles.