【发布时间】:2018-04-17 21:24:21
【问题描述】:
Gradle 依赖项
compile "org.springframework.boot:spring-boot-starter-web:2.0.1.RELEASE"
compile "org.springframework.boot:spring-boot-starter-actuator:2.0.1.RELEASE"
compile "org.springframework.boot:spring-boot-starter-aop:2.0.1.RELEASE"
我的计划任务
@Scheduled(fixedRate = 1000L * 57L)
@Timed("importCustomers")
open fun importCustomers() = importCustomerService.importCustomers()
当通过执行器端点 (http://xxx:yyy/actuator/metrics/importCustomers) 请求作业的指标时,我可以看到调用次数、最长时间和总时间。
有没有办法查看函数被调用的时间戳,或者至少是最近一次调用的时间?
例如,上次运行时间为 2018-04-17T17:00:00.000Z。
【问题讨论】:
标签: spring spring-boot spring-boot-actuator micrometer