Don't update CPU statistics before returning it to avoid synchronous open of "/proc/stat".

This commit is contained in:
levlam 2023-09-14 16:57:28 +03:00
parent 4e8ba65838
commit 1ec733a3f8
1 changed files with 0 additions and 1 deletions

View File

@ -230,7 +230,6 @@ void ClientManager::get_stats(td::Promise<td::BufferSlice> promise,
LOG(INFO) << "Failed to get memory statistics: " << r_mem_stat.error();
}
ServerCpuStat::update(td::Time::now());
auto cpu_stats = ServerCpuStat::instance().as_vector(td::Time::now());
for (auto &stat : cpu_stats) {
sb << stat.key_ << "\t" << stat.value_ << '\n';