aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorkungasc <kungasc@yandex-team.com>2023-07-31 15:40:59 +0300
committerkungasc <kungasc@yandex-team.com>2023-07-31 15:40:59 +0300
commitbc1247e1dfdca1b751a312dbc4d735e8ded26435 (patch)
tree0a695901421a0805b4bcf9f40a1b5d44bb51a265 /library
parentc6a030e7f93e83780c1047c62597fc72956959af (diff)
downloadydb-bc1247e1dfdca1b751a312dbc4d735e8ded26435.tar.gz
Check TProcStat.Fill result in library/cpp/actors/core/process_stats.cpp
Diffstat (limited to 'library')
-rw-r--r--library/cpp/actors/core/process_stats.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/library/cpp/actors/core/process_stats.cpp b/library/cpp/actors/core/process_stats.cpp
index b690d92d8d..f9028537c5 100644
--- a/library/cpp/actors/core/process_stats.cpp
+++ b/library/cpp/actors/core/process_stats.cpp
@@ -155,8 +155,9 @@ namespace {
}
void Bootstrap(const TActorContext& ctx) {
+ TryUpdateCounters();
ctx.Schedule(Interval, new TEvents::TEvWakeup());
- Self()->Become(&TDerived::StateWork);
+ static_cast<TDerived*>(this)->Become(&TDerived::StateWork);
}
STFUNC(StateWork) {
@@ -167,13 +168,14 @@ namespace {
private:
void Wakeup(const TActorContext& ctx) {
- Self()->UpdateCounters(ProcStat);
+ TryUpdateCounters();
ctx.Schedule(Interval, new TEvents::TEvWakeup());
}
- TDerived* Self() {
- ProcStat.Fill(getpid());
- return static_cast<TDerived*>(this);
+ void TryUpdateCounters() {
+ if (ProcStat.Fill(getpid())) {
+ static_cast<TDerived*>(this)->UpdateCounters(ProcStat);
+ }
}
private: