Skip to content

Add BufferPool metrics#305

Closed
giannello wants to merge 1 commit intomasterfrom
unknown repository
Closed

Add BufferPool metrics#305
giannello wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@giannello
Copy link
Copy Markdown

Add metrics for BufferPool (https://docs.oracle.com/javase/8/docs/api/java/lang/management/BufferPoolMXBean.html)

jvm_buffer_pool_bytes_used: Used bytes of a given JVM buffer pool.
jvm_buffer_pool_bytes_capacity: Bytes capacity of a given JVM buffer pool.
jvm_buffer_pool_buffers_used: Used buffers of a given JVM buffer pool.

@brian-brazil
Copy link
Copy Markdown
Contributor

This client is targeted at Java 6, and I'm afraid this bean was only added in Java 7.

@giannello
Copy link
Copy Markdown
Author

Indeed, that bean was introduced in Java7.
If you can share your preferred way to make sure this feature won't interfere with the java6 compatibility, I would be happy to rework my PR.

@brian-brazil
Copy link
Copy Markdown
Contributor

I'm not aware of a good way to do that. Do you have any suggestions?

@pjfanning
Copy link
Copy Markdown
Contributor

@giannello could you use java reflection to access BufferPoolMXBean? If the class is not found (eg when you run with Java 6 Runtime), then return zeroes for the new metrics and if the class is found then use reflection to access the values.

@giannello
Copy link
Copy Markdown
Author

@pjfanning thanks for the hint and for reminding me about this PR.

brian-brazil pushed a commit that referenced this pull request Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants