【发布时间】:2022-06-22 02:15:25
【问题描述】:
使用 Timer 作为 timer.record() ,得到如下结果
method_metrics_seconds_max{application="mydemo",class="com.demo.service.Impl.MetricsDemoService2Impl",method="getMethod1",} 0.21
method_metrics_seconds_count{application="mydemo",class="com.demo.service.Impl.MetricsDemoService2Impl",method="getMethod4",} 1.0
method_metrics_seconds_sum{application="mydemo",class="com.demo.service.Impl.MetricsDemoService2Impl",method="getMethod4",} 3.603
但我想得到真正的执行时间
找了很多资料都没找到
【问题讨论】:
-
请提供足够的代码,以便其他人更好地理解或重现问题。
-
real execution time是什么意思? -
以@Michael McFadyen为例,一个方法funA,执行了3次,执行时间分别为200ms,240ms,180ms,我们可以从micrometer timer-max得到240ms,但不能得到每一次的次数
标签: timer spring-boot-actuator micrometer