显示休眠 有关弹簧启动执行器的搜索统计信息



>我有一个 Spring Boot 应用程序 v. 2.3.0,具有以下依赖项:

  • 弹簧-引导-启动器-数据-JPA
  • 休眠搜索ORM版本5.11.5
  • 弹簧-启动-启动器-执行器

我的application.properties看起来像这样

# Enabling Actuator for all
management.endpoints.web.exposure.include=*
# Show Hibernate statistics. This works!
spring.jpa.properties.hibernate.generate_statistics=true
# Show Hibernate Search statistics. This works not!
spring.jpa.properties.hibernate.search.default.directory_provider = filesystem
spring.jpa.properties.hibernate.search.default.indexBase = /path/to/index
spring.jpa.properties.hibernate.search.generate_statistics=true

我可以在/actuator/metrics下看到休眠的统计信息,但是没有显示休眠搜索的统计信息。你知道,我该如何解决这个问题吗?

我只是猜测,但是...Spring 中可能有一些组件可以将 Hibernate ORM 提供的统计数据转换为出现在您的 Web 应用程序上的内容。据我所知,Spring 没有提供任何 Hibernate 搜索的集成,所以 Hibernate Search 缺少这个"翻译"组件,因此你看不到任何东西。

我建议你看看Hibernate ORM统计数据是如何出现在你的控制台上的;你可能需要为Hibernate搜索实现类似的东西。

最新更新