在本机编译时,system_cpu_usage 为 Nan
在我的 quarkus 应用程序中,我使用千分尺来检索指标(如本指南中所示: https://quarkus.io/指南/千分尺)。 在 JVM 模式下一切正常,但在本机模式下 system_cpu_usage 为“Nan”。 我尝试将千分尺提高到 1.8.4 并添加 :
{
"name":"com.sun.management.OperatingSystemMXBean", "allPublicMethods": true
},
到我的 Reflect-config.json 但没有成功。我还尝试使用 graalvm 跟踪代理生成 Reflect-config (和其他本机配置文件),但仍然没有成功。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是一个错误。
Micrometer is looking for a few known implementations of the MXBean:
https://github.com/micrometer-metrics/micrometer/blob/b087856355667abf9bf2386265edef8642e0e077/micrometer-core/src/main/java/io/千分尺/核心/仪器/活页夹/系统/processormetrics.java#l55 ,
以便可以找到应该调用的方法...
https://github.com/千分尺度/微米/blob/b087856355667abf9bf2386265Edef8642E0E077/mictotor-core/src/src/main/java/java/io/core/core/core/core/core/core/corem/instrument/instrument/instem/binder/binder/binder/binder/binder/processormetics.java #java#l80#l80 </
getfir”受到第一个列表的约束)。
我的猜测,但我怀疑Graal正在返回另一种类型,这是从这里开始的:
https://github.com/oracle/graal/blob/6ba65dad76a4f54f54f59e1ed2a62a62dedddddddddddd3afe39928/ Management/Managementsupport.java#l166
需要一些挖掘才能知道哪个,但是我将对千分尺打开一个问题,以便我们可以对其进行整理。
This may be a bug.
Micrometer is looking for a few known implementations of the MXBean:
https://github.com/micrometer-metrics/micrometer/blob/b087856355667abf9bf2386265edef8642e0e077/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/system/ProcessorMetrics.java#L55
so that it can find the methods that it should be invoking...
https://github.com/micrometer-metrics/micrometer/blob/b087856355667abf9bf2386265edef8642e0e077/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/system/ProcessorMetrics.java#L80
(Note specifically "getFirstClassFound", which is constrained against the first list).
Speculation on my part, but I suspect Graal is returning a different type, which is possible from here:
https://github.com/oracle/graal/blob/6ba65dad76a4f54fa59e1ed2a62dedd3afe39928/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/management/ManagementSupport.java#L166
would take some digging to know which, but I would open an issue with Micrometer so we can sort it out.