jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
177 stars 110 forks source link

Map support in addition to the current CompositeData #148

Closed ggrandes closed 4 years ago

ggrandes commented 4 years ago

Support for a basic type easier and lighter to implement in applications than CompositeData. Tested on OpenJDK 1.7.0_201

ggrandes commented 4 years ago

Thanks @cyrille-leclerc !

cyrille-leclerc commented 4 years ago

I get the following findbugs exception when building, I'm looking at this problem to release.

[INFO] org.jmxtrans.agent.Query.collectAndExportAttribute(MBeanServer, OutputWriter, ObjectName, String) makes inefficient use of keySet iterator instead of entrySet iterator [org.jmxtrans.agent.Query] At Query.java:[line 227] WMI_WRONG_MAP_ITERATOR
ggrandes commented 4 years ago

Well, I copied the construct of "if (attributeValue instanceof CompositeData)" in "if (attributeValue instanceof Map)" maintaining the same code-style, but entrySet is more efficient of course. Thanks for the feedback.

cyrille-leclerc commented 4 years ago

Shipped in 1.2.10