如何在不春季应用程序中使用千分尺 @timed
我有一个应用程序,该应用程序在纯Java + Apache Kafka流中实现(不是春季应用程序)。我需要添加千分尺和自定义指标。怎么做?我可以在方法上使用@Timed注释吗?
那定时班呢?我如何使用它?
我正在使用Microker-Registry-StatsD。
我已经注册了仪表注册表如下 zetrics.addregistry(new StatsMeterRegistry(Herestatsdconfig))
I've an app, which implemented in pure java + apache kafka streams (not spring app). I need to add micrometer and custom metrics. How to do that? Can I use @Timed annotation on the methods?
What about TimedAspect class? how I can use it?
I'm using micrometer-registry-statsd.
I've registered meter registry as followMetrics.addRegistry(new StatsMeterRegistry(HereStatsdConfig))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
终于我想出了。可以使用指标或指标来完成。指标类应用于没有DI的应用中。
Finally I figured out it. It can be done using Metrics.counter or Metrics.timer or other methods of micrometer.io library. Metrics class should be used in applications which don't have DI.