百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

MyPerf4J

> 数据库
开源

高性能的 Java APM。由 ASM 提供支持。试用它。测试它。如果您觉得它更好,请使用它。

3.6K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

高性能的 Java APM。由 ASM 提供支持。试用它。测试它。如果您觉得它更好,请使用它。

简体中文 | [English](./README.EN.md)

MyPerf4J

## 价值 * 快速定位性能瓶颈 * 快速定位故障原因 ## 优势 * [高性能](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%80%A7%E8%83%BD%E5%BC%80%E9%94%80): 单线程支持每秒 **1600 万次** 响应时间的记录,每次记录只花费 **63 纳秒** * [无侵入](https://github.com/LinShunKang/MyPerf4J/wiki/%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86#%E6%95%B0%E6%8D%AE%E9%87%87%E9%9B%86): 采用 **JavaAgent** 方式,对应用程序完全无侵入,无需修改应用代码 * [低内存](https://github.com/LinShunKang/MyPerf4J/wiki/%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86#%E6%95%B0%E6%8D%AE%E5%AD%98%E5%82%A8): 采用**内存复用**的方式,整个生命周期只产生极少的临时对象,不影响应用程序的 GC * 高实时: 支持**秒级统计**,最低统计粒度为 **1 秒**,并且是**全量统计**,不丢失任何一次记录 ## 文档 * [English Doc](https://github.com/LinShunKang/MyPerf4J/wiki/English-Doc) * [中文文档](https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc) ## 监控指标 MyPerf4J 为每个应用收集数十个监控指标,所有的监控指标都是实时采集和展现的。 下面是 MyPerf4J 目前支持的监控指标列表: - **[Method Metrics](https://grafana.com/dashboards/7766)**
[RPS,Count,Avg,Min,Max,StdDev,TP50, TP90, TP95, TP99, TP999, TP9999, TP100](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#method-metrics) - **[JVM Metrics](https://grafana.com/dashboards/8787)**
[Thread](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-thread-metrics),[Memory](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-memory-metrics),[ByteBuff](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-bytebuff-metrics),[GC](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-gc-metrics),[Class](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-class-metrics),[Compilation](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-compilation-metrics),[FileDescriptor](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8C%87%E6%A0%87#jvm-filedescriptor-metrics) > 想知道如何实现上述效果?请先按照[快速启动](https://github.com/LinShunKang/MyPerf4J#%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8)的描述启动应用,再按照[这里](https://github.com/LinShunKang/MyPerf4J/wiki/InfluxDB_)的描述进行安装配置即可。 ## 快速启动 MyPerf4J 采用 JavaAgent 配置方式,**透明化**接入应用,对应用代码完全**没有侵入**。 ### 下载 * 下载并解压 [MyPerf4J-ASM.zip](https://github.com/LinShunKang/Objects/blob/master/zips/CN/MyPerf4J-ASM-3.6.0.zip?raw=true) * 阅读解压出的 `README` 文件 * 修改解压出的 `MyPerf4J.properties` 配置文件中 `app_name`、`metrics.log.xxx` 和 `filter.packages.include` 的配置值 > 查看[配置文件模板](https://github.com/LinShunKang/Objects/blob/master/jars/MyPerf4J-3.x.properties)。想了解更多的配置?请看[这里](https://github.com/LinShunKang/MyPerf4J/wiki/3.x-%E9%85%8D%E7%BD%AE) ### 配置 在 JVM 启动参数里加上以下两个参数 * -javaagent:/path/to/MyPerf4J-ASM.jar * -DMyPerf4JPropFile=/path/to/MyPerf4J.properties > 形如:java -javaagent:/path/to/MyPerf4J-ASM.jar -DMyPerf4JPropFile=/path/to/MyPerf4J.properties `-jar yourApp.jar` > > 注意:如果您使用 JDK9 及其之上的版本,请额外添加 `--add-opens java.base/java.lang=ALL-UNNAMED` ### 运行 启动应用,监控日志输出到 /path/to/log/method_metrics.log: ``` … ``` ### 卸载 在 JVM 启动参数中去掉以下两个参数,重启即可卸载此工具。 * -javaagent:/path/to/MyPerf4J-ASM.jar * -DMyPerf4JPropFile=/path/to/MyPerf4J.properties ## 构建 您可以自行构建 MyPerf4J-ASM.jar * git clone [email protected]:LinShunKang/MyPerf4J.git * mvn clean package > MyPerf4J-ASM-${MyPerf4J-version}.jar 在 MyPerf4J-ASM/target/ 目录下 ## 问题 如果您有任何问题、疑问或者建议,您可以 [提交Issue](https://github.com/LinShunKang/MyPerf4J/issues/new/choose) 或者 [发送邮件](mailto:[email protected]) :) 注意,为了保障大家的时间,请保证您已经**完整阅读过**以下内容: * [提问模板](https://github.com/LinShunKang/MyPerf4J/wiki/%E6%8F%90%E9%97%AE%E6%A8%A1%E6%9D%BF) * [快速启动](https://github.com/LinShunKang/MyPerf4J#%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8) * [中文文档](https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc) * [常见问题](https://github.com/LinShunKang/MyPerf4J/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98) ## 已知用户 如果您在使用 MyPerf4J,请告诉我,您的使用对我来说非常重要:[https://github.com/LinShunKang/MyPerf4J/issues/30](https://github.com/LinShunKang/MyPerf4J/issues/30)(按登记顺序排列) ## 鸣谢 感谢 JetBrains [OpenSourceSupport](https://www.jetbrains.com/community/opensource/#support) 所提供的支持 : ) ## 项目捐赠 如果 MyPerf4J 对您有帮助,可以使用微信扫描下面的赞赏码,请我喝杯咖啡 : ) ## 参考项目 MyPerf4J 是受以下项目启发而来: * [Perf4J](https://github.com/perf4j/perf4j) * [TProfiler](https://github.com/alibaba/TProfiler) ## 更多信息 想更深入的了解 MyPerf4J?请看 [https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc](https://github.com/LinShunKang/MyPerf4J/wiki/Chinese-Doc)。

GitHub Issues· 5 开放

在 GitHub 查看全部
  • #40

    如果能监控JVM对象内存分配情况就更完美了

    enhancement更新于 2023年4月22日
  • #30

    Wanted: 您在使用 MyPerf4J 吗?/ who's using MyPerf4J ?

    help wanted更新于 2023年4月18日
  • #90

    File.renameTo及File.setReadOnly的问题

    bug更新于 2023年4月3日

核心特点

  • •快速定位性能瓶颈
  • •快速定位故障原因
  • •高性能: 单线程支持每秒 1600 万次 响应时间的记录,每次记录只花费 63 纳秒
  • •无侵入: 采用 JavaAgent 方式,对应用程序完全无侵入,无需修改应用代码
  • •低内存: 采用内存复用的方式,整个生命周期只产生极少的临时对象,不影响应用程序的 GC
  • •高实时: 支持秒级统计,最低统计粒度为 1 秒,并且是全量统计,不丢失任何一次记录
  • •English Doc
  • •Method Metrics<br/>
  • •JVM Metrics<br/>
  • •下载并解压 MyPerf4J-ASM.zip

> 标签

Javaagentapmbytecodediagnosis

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库