jmx-dev MBean attribute deprecation

Milan Mimica milan.mimica at gmail.com
Thu Jul 23 12:25:44 UTC 2020


Hello list

With deprecation of OperatingSystem#SystemCpuLoad in favor of
OperatingSystem#CpuLoad [1] an issue raised with generic tools that query
all MBean attributes. Querying CPU usage is not side-effect-free: the
immediate subsequent query for CPU load will often return a skewed value
(on Linux at least, haven't checked others)[2]. This results in exported
data where either new or deprecated MBean value is wrong and misleading.

There are many tools and libraries that generically export JMX metrics, so
I think this should be addressed somehow. Maybe we could add a property in
MBeanAttributeInfo which would mark the attribute as deprecated? These
tools could then skip such metrics.


[1]
https://docs.oracle.com/en/java/javase/14/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getSystemCpuLoad()
[2]
https://medium.com/@milan.mimica/the-java-cpu-usage-observer-effect-18808b18323f

-- 
Milan Mimica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/jmx-dev/attachments/20200723/1c600157/attachment.htm>


More information about the jmx-dev mailing list