MyPerf4J – High‑Performance Java Performance Monitoring and Statistics Tool
MyPerf4J is a Java‑agent based, low‑overhead monitoring solution that provides real‑time method, memory, GC and class metrics, enabling developers to quickly locate performance bottlenecks and assess service capacity in both development and production environments.
As the company grew, the original vertical architecture could no longer meet product demands; dozens of engineers working on a single project caused decreasing development efficiency.
To address this, the organization embarked on a service‑oriented transformation, which improved focus but introduced new challenges such as unknown service QPS, latency percentiles, slow‑response tracing, load balancing, and capacity planning.
To solve these problems, we introduce MyPerf4J, a high‑concurrency, low‑latency Java performance monitoring and statistics tool.
Usage Scenarios
Rapidly locate performance bottlenecks in a development environment.
Continuously monitor Java application performance metrics in production.
Features
High Performance: Single‑thread can record up to 10 million events per second, each record costing only 73 ns.
Non‑Intrusive: Implemented via JavaAgent, requiring no code changes.
Low Memory Footprint: Uses object reuse to minimize temporary allocations and avoid GC impact.
High Precision: Measures response time in nanoseconds.
Real‑Time: Supports second‑level monitoring (minimum 1 s interval).
Monitoring Metrics
MyPerf4J collects dozens of real‑time metrics for each application.
Method
RPS, Count, Avg, Min, Max, StdDev, TP50, TP90, TP95, TP99, TP999, TP9999, TP99999, TP100
Memory
HeapInit, HeapUsed, HeapCommitted, HeapMax, NonHeapInit, NonHeapUsed, NonHeapCommitted, NonHeapMax
JVM GC
CollectCount, CollectTime
JVM Class
Total, Loaded, Unloaded
Quick Start
MyPerf4J uses a JavaAgent for transparent integration without modifying application code.
Download
Download and unzip MyPerf4J-ASM.zip .
Read the extracted README file.
Modify MyPerf4J.properties to set app_name , metrics.log.xxx and filter.packages.include as needed.
Configuration
Add the following JVM arguments:
-javaagent:/path/to/MyPerf4J-ASM.jar
-DMyPerf4JPropFile=/path/to/MyPerf4J.propertiesRun
Start the application; monitoring logs will be written to /path/to/log/method_metrics.log .
Uninstall
Remove the two JVM arguments above and restart the JVM.
-javaagent:/path/to/MyPerf4J-ASM.jar
-DMyPerf4JPropFile=/path/to/MyPerf4J.propertiesOpen‑Source Repository
https://github.com/LinShunKang/MyPerf4J
END
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.