【发布时间】:2021-07-26 07:10:03
【问题描述】:
我想用 Actuator 监控我的 Spring Boot 应用程序,但我找不到任何方法来计算 SQL 查询的最小/最大/平均时间。
我使用了hibernate.generate_statistics,但它没有捕获 Sql 查询的执行时间。
是否有可用于此目的的 Hibernate 千分尺?
【问题讨论】:
标签: spring-boot hibernate jpa spring-boot-actuator
我想用 Actuator 监控我的 Spring Boot 应用程序,但我找不到任何方法来计算 SQL 查询的最小/最大/平均时间。
我使用了hibernate.generate_statistics,但它没有捕获 Sql 查询的执行时间。
是否有可用于此目的的 Hibernate 千分尺?
【问题讨论】:
标签: spring-boot hibernate jpa spring-boot-actuator
添加 hibernate-micrometer 依赖并使用 SpringBoot 2.5.x 或更高版本就足够了。无需额外配置。
不幸的是,我找不到旧 SpringBoot 的替代品,而且我自己也无法让它在 SpringBoot 2.4.x 上仅使用 5.5.5 工作
【讨论】: