• turboboost55's avatar
    metrics: improve accuracy of CPU gauges (#26793) · 544e4a70
    turboboost55 authored
    This PR changes metrics collection to actually measure the time interval between collections, rather
    than assume 3 seconds. I did some ad hoc profiling, and on slower hardware (eg, my Raspberry Pi 4)
    I routinely saw intervals between 3.3 - 3.5 seconds, with some being as high as 4.5 seconds. This
    will generally cause the CPU gauge readings to be too high, and in some cases can cause impossibly
    large values for the CPU load metrics (eg. greater than 400 for a 4 core CPU).
    
    ---------
    Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
    544e4a70
cputime_unix.go 1.31 KB