Reflective version of #305#341
Merged
brian-brazil merged 2 commits intomasterfrom Feb 16, 2018
unknown repository
Merged
Conversation
| * | ||
| * Can be replaced with a simple access once JDK 1.7 compatibility is baseline. | ||
| * | ||
| * @author marcus |
Contributor
There was a problem hiding this comment.
We don't use these in this repo
| import java.util.logging.Logger; | ||
|
|
||
| /** | ||
| * A backward compatible way to get the buffer MX beans as well |
Contributor
There was a problem hiding this comment.
Full sentences with full stops please.
| getCount = bufferPoolMXBeanClass.getMethod("getCount"); | ||
|
|
||
| } catch (ClassNotFoundException e) { | ||
| LOGGER.info("BufferPoolMXBean not available, not metrics for buffer pools will be exported"); |
Contributor
There was a problem hiding this comment.
I'm not sure we should be putting this in the logs, just debug is fine.
s/not/no/
| @Override | ||
| public List<MetricFamilySamples> collect() { | ||
| List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); | ||
| addBufferPoolMetrics(mfs); |
Contributor
There was a problem hiding this comment.
This function can be inlined.
|
|
||
| void addBufferPoolMetrics(List<MetricFamilySamples> sampleFamilies) { | ||
| GaugeMetricFamily used = new GaugeMetricFamily( | ||
| "jvm_buffer_pool_bytes_used", |
Contributor
There was a problem hiding this comment.
jvm_buffer_pool_used_bytes
The unit goes last
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a reflective version of #305
I've actually no idea how to write meaningful tests for that, it works in my context.