diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/actors/core/process_stats.cpp | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/actors/core/process_stats.cpp')
-rw-r--r-- | library/cpp/actors/core/process_stats.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/actors/core/process_stats.cpp b/library/cpp/actors/core/process_stats.cpp index 0e1dbd0031..3edbaded63 100644 --- a/library/cpp/actors/core/process_stats.cpp +++ b/library/cpp/actors/core/process_stats.cpp @@ -25,11 +25,11 @@ namespace NActors { static bool ExtractVal(const TString& str, const TString& name, TVal& res) { if (!str.StartsWith(name)) return false; - size_t pos = name.size(); - while (pos < str.size() && (str[pos] == ' ' || str[pos] == '\t')) { + size_t pos = name.size(); + while (pos < str.size() && (str[pos] == ' ' || str[pos] == '\t')) { pos++; } - res = atol(str.data() + pos); + res = atol(str.data() + pos); return true; } @@ -63,7 +63,7 @@ namespace NActors { TFileInput procStat("/proc/" + strPid + "/stat"); procStat.ReadLine(str); if (!str.empty()) { - sscanf(str.data(), + sscanf(str.data(), "%d %*s %c %d %d %d %d %d %u %lu %lu " "%lu %lu %lu %lu %ld %ld %ld %ld %ld " "%ld %llu %lu %ld %lu", @@ -81,7 +81,7 @@ namespace NActors { TFileInput statm("/proc/" + strPid + "/statm"); statm.ReadLine(str); TVector<TString> fields; - StringSplitter(str).Split(' ').SkipEmpty().Collect(&fields); + StringSplitter(str).Split(' ').SkipEmpty().Collect(&fields); if (fields.size() >= 7) { ui64 resident = FromString<ui64>(fields[1]); ui64 shared = FromString<ui64>(fields[2]); |