Reputation: 23
use Timer
as timer.record()
, and get results like below
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
but I want to get the real execution time
I looked for a lot of information, but couldn't find
Upvotes: 2
Views: 2679
Reputation: 6863
Metrics are basically aggregated datapoints in time. I think what you are asking is the raw data (not aggregated). Even though metric libraries will not give the raw data to you (because they are aggregating the data), you have a couple of options:
Upvotes: 2