Codahale Metrics: using @Timed metrics annotation in plain Java

后端 未结 8 981
南方客
南方客 2020-12-29 03:18

I am trying to add metrics to a plain Java application using codahale metrics. I\'d like to use the @Timed annotation, but it is unclear to me which MetricRegistry it uses,

8条回答
  •  爱一瞬间的悲伤
    2020-12-29 03:33

    As the other answer stated, you have to have something in the application to listen for your instantiated classes and check them for the @Timed annotation.

    If you're using Guice, you could use: https://github.com/palominolabs/metrics-guice

提交回复
热议问题