Log if failed to get CPU statistics on supported platforms.

This commit is contained in:
levlam 2024-12-04 17:31:44 +03:00
parent 65bcaaa572
commit 01ee58bd27

View File

@ -23,6 +23,9 @@ ServerCpuStat::ServerCpuStat() {
void ServerCpuStat::update(double now) {
auto r_cpu_stat = td::cpu_stat();
if (r_cpu_stat.is_error()) {
if (r_cpu_stat.error().message() != "Not supported") {
LOG(ERROR) << "Failed to get CPU statistics: " << r_cpu_stat.error();
}
return;
}