orangeCatDeveloper commented on issue #3533:
URL: https://github.com/apache/hertzbeat/issues/3533#issuecomment-5861052041
Root cause, still present on master: CPU usage is computed as
`usage=100-idle`, where `idle` comes from `vmstat 1 2 | awk 'NR==4{print
$15}'`. vmstat only prints whole percentages and this samples a single second,
so the value is always an integer and jumps between samples.
https://github.com/apache/hertzbeat/blob/8104d7057c72f9c18dea31d32e076750d2c34020/hertzbeat-manager/src/main/resources/define/app-linux.yml#L373
The same command is used by the other Linux-family templates (centos,
ubuntu, debian, redhat, rockylinux, almalinux, euleros, opensuse, coreos,
freebsd, linux_script). Computing the usage from two `/proc/stat` readings
would give decimal precision.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]