Add per-event JVM GC duration tracking #17472
Open
+445
−76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides enhances JVM GC metrics to the
JvmMonitor
monitor. Namely:jvm/gc/pause
: Stop-the-world garbage collection JVM-reported pause time (ms)jvm/gc/concurrentTime
: JVM-reported time spent in concurrent phases of CMS pauses (ms)Description
Pulls GC event subscription logic from https://github.com/Netflix/spectator. I'm wondering whether more metrics from this list: https://netflix.github.io/atlas-docs/spectator/lang/java/ext/jvm-gc/#jvmgcpause – we currently take aggregate statistics from getMemoryPoolMXBeans() on total mem usage, etc. via
GcSpaceCollector
.Release note
Adds
jvm/gc/pause
andjvm/gc/concurrentTime
metrics to JvmMonitor.Key changed/added classes in this PR
docs/operations/metrics.md
processing/src/main/java/org/apache/druid/java/util/metrics/EventBuffer.java
processing/src/main/java/org/apache/druid/java/util/metrics/JvmMonitor.java
processing/src/main/java/org/apache/druid/java/util/metrics/JvmMonitorConfig.java
processing/src/main/java/org/apache/druid/java/util/metrics/Monitors.java
processing/src/main/java/org/apache/druid/java/util/metrics/jvm/gc/GcEvent.java
processing/src/test/java/org/apache/druid/java/util/metrics/EventBufferTest.java
processing/src/test/java/org/apache/druid/java/util/metrics/JvmMonitorTest.java
processing/src/test/java/org/apache/druid/java/util/metrics/MonitorsTest.java
server/src/main/java/org/apache/druid/server/metrics/MetricsModule.java
This PR has: