nodesource / nsolid

N|Solid Runtime
Other
61 stars 4 forks source link

src: initialize prev_idle_time_ on ThreadMetrics #156

Closed santigimeno closed 4 months ago

santigimeno commented 4 months ago

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.