Skip to content

Commit

Permalink
Revert "Improve harmonizer on pulling stats (ydb-platform#5170)"
Browse files Browse the repository at this point in the history
This reverts commit 203c1cc.
  • Loading branch information
kruall committed Aug 26, 2024
1 parent 92703ce commit 8c18d6d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 27 deletions.
2 changes: 1 addition & 1 deletion ydb/library/actors/core/executor_pool_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ namespace NActors {
}
TExecutorThreadCtx& threadCtx = Threads[threadIdx];
TExecutorThreadStats stats;
threadCtx.Thread->GetCurrentStatsForHarmonizer(stats);
threadCtx.Thread->GetCurrentStats(stats);
return {Ts2Us(stats.SafeElapsedTicks), static_cast<double>(stats.CpuUs), stats.NotEnoughCpuExecutions};
}

Expand Down
9 changes: 1 addition & 8 deletions ydb/library/actors/core/executor_pool_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,12 @@ void TSharedExecutorPool::GetSharedStats(i16 poolId, std::vector<TExecutorThread
}
}

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

TCpuConsumption TSharedExecutorPool::GetThreadCpuConsumption(i16 poolId, i16 threadIdx) {
if (threadIdx >= SharedThreadCount) {
return {0.0, 0.0};
}
TExecutorThreadStats stats;
Threads[threadIdx].Thread->GetSharedStatsForHarmonizer(poolId, stats);
Threads[threadIdx].Thread->GetSharedStats(poolId, stats);
return {Ts2Us(stats.SafeElapsedTicks), static_cast<double>(stats.CpuUs), stats.NotEnoughCpuExecutions};
}

Expand Down
1 change: 0 additions & 1 deletion ydb/library/actors/core/executor_pool_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace NActors {

TSharedExecutorThreadCtx *GetSharedThread(i16 poolId);
void GetSharedStats(i16 pool, std::vector<TExecutorThreadStats>& statsCopy);
void GetSharedStatsForHarmonizer(i16 pool, std::vector<TExecutorThreadStats>& statsCopy);
TCpuConsumption GetThreadCpuConsumption(i16 poolId, i16 threadIdx);
std::vector<TCpuConsumption> GetThreadsCpuConsumption(i16 poolId);

Expand Down
13 changes: 0 additions & 13 deletions ydb/library/actors/core/executor_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,19 +811,6 @@ namespace NActors {
statsCopy.Aggregate(SharedStats[poolId]);
}

void TGenericExecutorThread::GetCurrentStatsForHarmonizer(TExecutorThreadStats& statsCopy) {
statsCopy.SafeElapsedTicks = RelaxedLoad(&Ctx.Stats->SafeElapsedTicks);
statsCopy.CpuUs = RelaxedLoad(&Ctx.Stats->CpuUs);
statsCopy.NotEnoughCpuExecutions = RelaxedLoad(&Ctx.Stats->NotEnoughCpuExecutions);
}

void TGenericExecutorThread::GetSharedStatsForHarmonizer(i16 poolId, TExecutorThreadStats &stats) {
stats.SafeElapsedTicks = RelaxedLoad(&SharedStats[poolId].SafeElapsedTicks);
stats.CpuUs = RelaxedLoad(&SharedStats[poolId].CpuUs);
stats.NotEnoughCpuExecutions = RelaxedLoad(&SharedStats[poolId].NotEnoughCpuExecutions);
}


TGenericExecutorThreadCtx::~TGenericExecutorThreadCtx()
{}
}
3 changes: 0 additions & 3 deletions ydb/library/actors/core/executor_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ namespace NActors {
void GetCurrentStats(TExecutorThreadStats& statsCopy);
void GetSharedStats(i16 poolId, TExecutorThreadStats &stats);

void GetCurrentStatsForHarmonizer(TExecutorThreadStats& statsCopy);
void GetSharedStatsForHarmonizer(i16 poolId, TExecutorThreadStats &stats);

TThreadId GetThreadId() const; // blocks, must be called after Start()
TWorkerId GetWorkerId() const;

Expand Down
2 changes: 1 addition & 1 deletion ydb/library/actors/core/harmonizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ TCpuConsumption TPoolInfo::PullStats(ui64 ts) {
}
TVector<TExecutorThreadStats> sharedStats;
if (Shared) {
Shared->GetSharedStatsForHarmonizer(Pool->PoolId, sharedStats);
Shared->GetSharedStats(Pool->PoolId, sharedStats);
}

for (ui32 sharedIdx = 0; sharedIdx < SharedInfo.size(); ++sharedIdx) {
Expand Down

0 comments on commit 8c18d6d

Please sign in to comment.