You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The constructor for SystemUsageCollectorHostedService sets a timestamp to the current process' start time. In the CollectData method we calculate the cpuTimeElapsed as DateTime.UtcNow - _lastTimeStamp, but they are in different timezones. The resulting first reading is incorrect. This is particularly evident for system clocks that are ahead of UTC and the resulting calculation is negative.
I am happy to fix the issue. I have made a fork but needed an issue number. If there is an agreement that this is a bug then I will submit a PR for it.
The constructor for SystemUsageCollectorHostedService sets a timestamp to the current process' start time. In the CollectData method we calculate the cpuTimeElapsed as DateTime.UtcNow - _lastTimeStamp, but they are in different timezones. The resulting first reading is incorrect. This is particularly evident for system clocks that are ahead of UTC and the resulting calculation is negative.
The text was updated successfully, but these errors were encountered: