Pepper Metrics是我與同事開發的一個開源工具(github.com/zrbcool/pep…),其經過收集jedis/mybatis/httpservlet/dubbo/motan的運行性能統計,並暴露成prometheus等主流時序數據庫兼容數據,經過grafana展現趨勢。其插件化的架構也很是方便使用者擴展並集成其餘開源組件。
請你們給個star,同時歡迎你們成爲開發者提交PR一塊兒完善項目。html
安裝前提軟件java
yum install perf -y
yum install gcc -y
yum install gcc-c++
yum install cmake -y
複製代碼
apt install linux-tools-generic
apt install linux-tools-common
複製代碼
# 參考 http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#Java
export JAVA_HOME=/root/jdk1.8.0_181
export PATH=$JAVA_HOME/bin:$PATH
git clone --depth=1 https://github.com/jrudolph/perf-map-agent
cd perf-map-agent
cmake .
make
bin/create-links-in /usr/bin
git clone https://github.com/brendangregg/FlameGraph.git
export FLAMEGRAPH_DIR=/root/git/FlameGraph
# jvm啓動參數須要增長
-XX:+PreserveFramePointer
perf-java-flames 21322
export PERF_RECORD_SECONDS=45
複製代碼
svg格式的圖片能夠下鑽,點擊查看:linux
github.com/jvm-profili… blog.alicegoldfuss.com/making-flam… github.com/mboussaa/do… www.batey.info/docker-jvm-…c++
請參考筆者的另外一篇文章Docker中使用FlameGraph分析JVM應用性能git
https://www.meiwen.com.cn/subject/xafqkqtx.html
https://bugs.openjdk.java.net/browse/JDK-8068945
https://bugs.openjdk.java.net/browse/JDK-6515172
http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-December/016477.html
https://medium.com/netflix-techblog/java-in-flames-e763b3d32166
https://blog.codecentric.de/en/2017/09/jvm-fire-using-flame-graphs-analyse-performance/
https://github.com/jvm-profiling-tools/honest-profiler/wiki/How-to-Run
https://gperftools.github.io/gperftools/pprof-vsnprintf-big.gif
https://github.com/jvm-profiling-tools/perf-map-agent
http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#Java
http://www.brendangregg.com/blog/2014-06-12/java-flame-graphs.html
https://github.com/brendangregg/FlameGraph
複製代碼
github.com/zrbcool/blo…github