Make sure prev_idle_time_ is initialize in the
ThreadMetrics::ThreadMetrics(SharedEnvInst envinst) constructor so the loop utilization calculations are correct, otherwise the default value 0 is used which may lead to meaningless huge values (greater than 1 for the matter).
No need to initialize this value in the
ThreadMetrics::ThreadMetrics(uint64_t thread_id) as this is only used in the EnvInst constructor on which having a value of 0 makes sense.
Make sure
prev_idle_time_
is initialize in theThreadMetrics::ThreadMetrics(SharedEnvInst envinst)
constructor so the loop utilization calculations are correct, otherwise the default value 0 is used which may lead to meaningless huge values (greater than 1 for the matter). No need to initialize this value in theThreadMetrics::ThreadMetrics(uint64_t thread_id)
as this is only used in theEnvInst
constructor on which having a value of 0 makes sense.