Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add per-event JVM GC duration tracking #17472

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtuglu-netflix
Copy link
Contributor

@jtuglu-netflix jtuglu-netflix commented Nov 13, 2024

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 and jvm/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:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

Comment on lines +73 to +74
@SuppressWarnings("unused")
byte[] b = new byte[1024 * 1024 * 50];

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'byte[] b' is never read.
@jtuglu-netflix jtuglu-netflix marked this pull request as ready for review November 14, 2024 09:02
@jtuglu-netflix jtuglu-netflix force-pushed the add-per-event-gc-duration-tracking branch from f4db019 to a3b7593 Compare November 14, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant