aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkruall <kruall@ydb.tech>2023-12-07 18:47:18 +0300
committerkruall <kruall@ydb.tech>2023-12-07 19:30:15 +0300
commit4f92e99225de95325e46751b918b43555ffc336e (patch)
tree613fba10e1a3f189693a4cc617e967bfe4aab6d5
parentbc525b296946561b2557302f9a011f8454d6d42f (diff)
downloadydb-4f92e99225de95325e46751b918b43555ffc336e.tar.gz
Fix elapsed microsec, KIKIMR-18440
-rw-r--r--ydb/library/actors/core/executor_pool_basic.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/ydb/library/actors/core/executor_pool_basic.cpp b/ydb/library/actors/core/executor_pool_basic.cpp
index 624af1c1c2..1d5377a4d4 100644
--- a/ydb/library/actors/core/executor_pool_basic.cpp
+++ b/ydb/library/actors/core/executor_pool_basic.cpp
@@ -160,11 +160,11 @@ namespace NActors {
TWorkerId workerId = wctx.WorkerId;
Y_DEBUG_ABORT_UNLESS(workerId < PoolThreads);
- TTimers timers;
+ TlsThreadContext->Timers.Reset();
if (Harmonizer) {
LWPROBE(TryToHarmonize, PoolId, PoolName);
- Harmonizer->Harmonize(timers.HPStart);
+ Harmonizer->Harmonize(TlsThreadContext->Timers.HPStart);
}
if (workerId >= 0) {
@@ -176,8 +176,8 @@ namespace NActors {
while (!StopFlag.load(std::memory_order_acquire)) {
if (!semaphore.OldSemaphore || semaphore.CurrentSleepThreadCount < 0) {
if (workerId < 0 || !wctx.IsNeededToWaitNextActivation) {
- timers.HPNow = GetCycleCountFast();
- wctx.AddElapsedCycles(ActorSystemIndex, timers.HPNow - timers.HPStart);
+ TlsThreadContext->Timers.HPNow = GetCycleCountFast();
+ wctx.AddElapsedCycles(ActorSystemIndex, TlsThreadContext->Timers.HPNow - TlsThreadContext->Timers.HPStart);
return 0;
}
@@ -195,11 +195,11 @@ namespace NActors {
Threads[workerId].ExchangeState(TExecutorThreadCtx::WS_RUNNING);
}
AtomicDecrement(Semaphore);
- timers.HPNow = GetCycleCountFast();
- timers.Elapsed += timers.HPNow - timers.HPStart;
- wctx.AddElapsedCycles(ActorSystemIndex, timers.Elapsed);
- if (timers.Parked > 0) {
- wctx.AddParkedCycles(timers.Parked);
+ TlsThreadContext->Timers.HPNow = GetCycleCountFast();
+ TlsThreadContext->Timers.Elapsed += TlsThreadContext->Timers.HPNow - TlsThreadContext->Timers.HPStart;
+ wctx.AddElapsedCycles(ActorSystemIndex, TlsThreadContext->Timers.Elapsed);
+ if (TlsThreadContext->Timers.Parked > 0) {
+ wctx.AddParkedCycles(TlsThreadContext->Timers.Parked);
}
return activation;