Skip to content

Commit 3120a54

Browse files
authored
stable-25-2: Add metric resources.cpu.total_core_percents (#27477)
2 parents 00b6a6f + 5844857 commit 3120a54

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ydb/core/sys_view/service/ext_counters.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class TExtCountersUpdaterActor
2727
TCounterPtr StorageUsedBytesOnHdd;
2828
TVector<TCounterPtr> CpuUsedCorePercents;
2929
TVector<TCounterPtr> CpuLimitCorePercents;
30+
TCounterPtr TotalCores;
3031
THistogramPtr ExecuteLatencyMs;
3132

3233
TCounterPtr AnonRssSize;
@@ -74,6 +75,17 @@ class TExtCountersUpdaterActor
7475
"resources.cpu.limit_core_percents", false);
7576
}
7677

78+
double totalCores = 0;
79+
for (const auto& pool : Config.Pools) {
80+
if (pool.Name != "IO") {
81+
totalCores += pool.ThreadCount;
82+
}
83+
}
84+
TotalCores = ydbGroup->GetNamedCounter("name", "resources.cpu.total_core_percents", false);
85+
if (TotalCores) {
86+
TotalCores->Set(totalCores * 100);
87+
}
88+
7789
ExecuteLatencyMs = ydbGroup->FindNamedHistogram("name", "table.query.execution.latency_milliseconds");
7890

7991
Schedule(TDuration::Seconds(1), new TEvents::TEvWakeup);

0 commit comments

Comments
 (0)