Skip to content

Commit

Permalink
mention Hibernate JFR in the Short Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Dec 16, 2024
1 parent 597f74f commit af679e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ and `com.github.ben-manes.caffeine:jcache`
or `org.eclipse:yasson`
| <<spatial,Hibernate Spatial>> | `org.hibernate.orm:hibernate-spatial`
| <<envers,Envers>>, for auditing historical data | `org.hibernate.orm:hibernate-envers`
| <<jfr,Hibernate JFR>>, for monitoring via Java Flight Recorder | `org.hibernate.orm:hibernate-jfr`
|===

You might also add the Hibernate {enhancer}[bytecode enhancer] to your
Expand Down
11 changes: 11 additions & 0 deletions documentation/src/main/asciidoc/introduction/Tuning.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,17 @@ long publisherCacheMissCount =
Hibernate's statistics enable observability.
Both {micrometer}[Micrometer] and {smallrye-metrics}[SmallRye Metrics] are capable of exposing these metrics.

[[jfr]]
=== Using Java Flight Recorder

Hibernate JFR is a separate module which reports events to link:https://developers.redhat.com/blog/2020/08/25/get-started-with-jdk-flight-recorder-in-openjdk-8u[Java Flight Recorder].
This is different to reporting aggregated <<statistics,metrics>> via a tool like Micrometer, since JFR records information about the timing and duration of each discrete event, along with a stack trace.
If anything, the information reported by JFR is a little _too_ detailed to make it really useful for performance tuning--it's perhaps more useful for _troubleshooting_.

No special configuration is required to use Hibernate JFR.
Just include `org.hibernate.orm:hibernate-jfr` as a runtime dependency.
In particular, you _don't_ need to enable `hibernate.generate_statistics`.

[[slow-queries]]
=== Tracking down slow queries

Expand Down

0 comments on commit af679e1

Please sign in to comment.