[Telemetry SWX] Convert user idle time to ms
idle_time_user_hz is measured in USER_HZ (clock ticks), a system constant accessible via sysconf(_SC_CLK_TCK) (clock ticks / second). Dividing the two results in the number of idle seconds and multiplying by 1000 gets the result in milliseconds. Add a wrapper around LogicalCpuInfoPtr::UncheckedConvertPtr to make unittesting of the function easier without mocking the system call sysconf(). Add tests for checking LogicalCpuInfoPtr::UncheckedConvertPtr. Bug: b:161219494 Change-Id: I0c01f63100beea5315e1cc8f215eeb2fac6e76ff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2301144Reviewed-by:Oleh Lamzin <lamzin@google.com> Reviewed-by:
Mahmoud Gawad <mgawad@google.com> Reviewed-by:
Tom Sepez <tsepez@chromium.org> Commit-Queue: Laurențiu Olteanu <lolteanu@google.com> Cr-Commit-Position: refs/heads/master@{#790293}
Showing
Please register or sign in to comment