Skip to content

Commit 3c1c2f7

Browse files
authored
Revert 24-3: Revert #9477 #9139 (#9560)
1 parent 979fcef commit 3c1c2f7

12 files changed

+173
-639
lines changed

ydb/library/actors/core/executor_pool.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ namespace NActors {
1515
class ISchedulerCookie;
1616

1717
struct TCpuConsumption {
18-
double ElapsedUs = 0;
19-
double CpuUs = 0;
18+
double ConsumedUs = 0;
19+
double BookedUs = 0;
2020
ui64 NotEnoughCpuExecutions = 0;
2121

2222
void Add(const TCpuConsumption& other) {
23-
ElapsedUs += other.ElapsedUs;
24-
CpuUs += other.CpuUs;
23+
ConsumedUs += other.ConsumedUs;
24+
BookedUs += other.BookedUs;
2525
NotEnoughCpuExecutions += other.NotEnoughCpuExecutions;
2626
}
2727
};

ydb/library/actors/core/executor_pool_basic.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@ namespace NActors {
408408
poolStats.DecreasingThreadsByHoggishState = stats.DecreasingThreadsByHoggishState;
409409
poolStats.DecreasingThreadsByExchange = stats.DecreasingThreadsByExchange;
410410
poolStats.PotentialMaxThreadCount = stats.PotentialMaxThreadCount;
411-
poolStats.MaxElapsedCpuUs = stats.MaxElapsedCpu;
412-
poolStats.MinElapsedCpuUs = stats.MinElapsedCpu;
413-
poolStats.MaxCpuUs = stats.MaxCpu;
414-
poolStats.MinCpuUs = stats.MinCpu;
411+
poolStats.MaxConsumedCpuUs = stats.MaxConsumedCpu;
412+
poolStats.MinConsumedCpuUs = stats.MinConsumedCpu;
413+
poolStats.MaxBookedCpuUs = stats.MaxBookedCpu;
414+
poolStats.MinBookedCpuUs = stats.MinBookedCpu;
415415
}
416416

417417
statsCopy.resize(MaxFullThreadCount + 1);
@@ -430,7 +430,7 @@ namespace NActors {
430430
void TBasicExecutorPool::GetExecutorPoolState(TExecutorPoolState &poolState) const {
431431
if (Harmonizer) {
432432
TPoolHarmonizerStats stats = Harmonizer->GetPoolStats(PoolId);
433-
poolState.UsedCpu = stats.AvgElapsedCpu;
433+
poolState.UsedCpu = stats.AvgConsumedCpu;
434434
poolState.PossibleMaxLimit = stats.PotentialMaxThreadCount;
435435
} else {
436436
poolState.PossibleMaxLimit = poolState.MaxLimit;

ydb/library/actors/core/executor_pool_io.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace NActors {
140140

141141
void TIOExecutorPool::GetCurrentStats(TExecutorPoolStats& poolStats, TVector<TExecutorThreadStats>& statsCopy) const {
142142
poolStats.CurrentThreadCount = PoolThreads;
143-
poolStats.DefaultThreadCount = 0;
143+
poolStats.DefaultThreadCount = PoolThreads;
144144
poolStats.MaxThreadCount = PoolThreads;
145145
poolStats.PotentialMaxThreadCount = PoolThreads;
146146
statsCopy.resize(PoolThreads + 1);
@@ -156,7 +156,7 @@ namespace NActors {
156156
void TIOExecutorPool::GetExecutorPoolState(TExecutorPoolState &poolState) const {
157157
if (Harmonizer) {
158158
TPoolHarmonizerStats stats = Harmonizer->GetPoolStats(PoolId);
159-
poolState.UsedCpu = stats.AvgElapsedCpu;
159+
poolState.UsedCpu = stats.AvgConsumedCpu;
160160
}
161161
poolState.CurrentLimit = PoolThreads;
162162
poolState.MaxLimit = PoolThreads;

ydb/library/actors/core/executor_pool_shared.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ void TSharedExecutorPool::GiveHalfThread(i16 from, i16 to) {
143143
}
144144

145145
void TSharedExecutorPool::GetSharedStats(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
146-
statsCopy.resize(SharedThreadCount);
146+
statsCopy.resize(SharedThreadCount + 1);
147147
for (i16 i = 0; i < SharedThreadCount; ++i) {
148-
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i]);
148+
Threads[i].Thread->GetSharedStats(poolId, statsCopy[i + 1]);
149149
}
150150
}
151151

152152
void TSharedExecutorPool::GetSharedStatsForHarmonizer(i16 poolId, std::vector<TExecutorThreadStats>& statsCopy) {
153-
statsCopy.resize(SharedThreadCount);
153+
statsCopy.resize(SharedThreadCount + 1);
154154
for (i16 i = 0; i < SharedThreadCount; ++i) {
155-
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i]);
155+
Threads[i].Thread->GetSharedStatsForHarmonizer(poolId, statsCopy[i + 1]);
156156
}
157157
}
158158

ydb/library/actors/core/executor_thread.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ namespace NActors {
487487
ExecutorPool->ScheduleActivation(capturedActivation);
488488
}
489489
if (!activation) {
490-
break;
490+
return {IsSharedThread, wasWorking};
491491
}
492492
executeActivation(activation, false);
493493
}

0 commit comments

Comments
 (0)