【问题标题】:How can I Measure Hibernate/JPA SQL Queries min, max and average Execution time With Actuator如何使用 Actuator 测量 Hibernate/JPA SQL 查询的最小、最大和平均执行时间
【发布时间】:2021-07-26 07:10:03
【问题描述】:

我想用 Actuator 监控我的 Spring Boot 应用程序,但我找不到任何方法来计算 SQL 查询的最小/最大/平均时间。

我使用了hibernate.generate_statistics,但它没有捕获 Sql 查询的执行时间。

是否有可用于此目的的 Hibernate 千分尺?

【问题讨论】:

    标签: spring-boot hibernate jpa spring-boot-actuator


    【解决方案1】:
    【解决方案2】:

    添加 hibernate-micrometer 依赖并使用 SpringBoot 2.5.x 或更高版本就足够了。无需额外配置。

    不幸的是,我找不到旧 SpringBoot 的替代品,而且我自己也无法让它在 SpringBoot 2.4.x 上仅使用 5.5.5 工作

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2022-10-26
      • 1970-01-01
      • 2017-08-19
      • 2017-03-31
      • 1970-01-01
      • 2015-04-12
      相关资源
      最近更新 更多