dropwizard.metrics:metrics-core最新版本中的JmxReporter替代品 [英] Alternative to JmxReporter in dropwizard.metrics:metrics-core latest release
问题描述
因为 codahale-metrics
已移至 io.
下.我们代码中的一个实现是利用该类:
Since codahale-metrics
have been moved under io.
. An implementation in our code was making use of the class:
import com.codahale.metrics.JmxReporter
具有依赖版本
<metrics.core.version>3.2.2</metrics.core.version>
现在,我们正计划升级到该工件的最新版本
Now that, we are planning to upgrade to the latest release for the artifact
<metrics.core.version>4.1.0-rc3</metrics.core.version>
这不再是我们正在使用的类了吗,这已经迁移到其他工件了吗?还是现在可以使用 JmxReporter
的替代方法?
this no more has the class we were using, has this been migrated to some other artifact or is there an alternative to using the JmxReporter
now?
PS :已经在互联网上搜索了其发行说明和替代版本,但尚未找到与此相关的结果.
PS: Have searched for their release notes and alternatives the over internet but couldn't find a relevant result to this yet.
推荐答案
After some hours of wait and searching through each incremental release notes, I could find it in the release notes of version 4.0.0
that has an item listed as:
将JMX报告移至
metrics-jmx
模块
因此,现在使用类 JmxReporter
的正确方法是使用对不同模块的依赖项:
Hence now the correct way to use the class JmxReporter
would be to using the dependency on different module:
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jmx</artifactId>
<version>4.1.0-rc3</version>
</dependency>
,并且导入中的软件包需要修改为:
and also that the package in the imports needs to be modified as:
import com.codahale.metrics.jmx.JmxReporter;
这篇关于dropwizard.metrics:metrics-core最新版本中的JmxReporter替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!