aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkruall <kruall@ydb.tech>2023-08-23 16:31:19 +0300
committerkruall <kruall@ydb.tech>2023-08-23 18:41:23 +0300
commit716a5e3f2a108d220896b9374a1a81e811ab2710 (patch)
treed30afb4bac94c9b0b1e30315d6e495ed4e87cc8c
parentdf5d7c7a188b512ef8fe948f87191f4533a3c72c (diff)
downloadydb-716a5e3f2a108d220896b9374a1a81e811ab2710.tar.gz
Add metrics for ydb about AS1.4, KIKIMR-18214
-rw-r--r--ydb/core/sys_view/service/ext_counters.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/ydb/core/sys_view/service/ext_counters.cpp b/ydb/core/sys_view/service/ext_counters.cpp
index 9b6a8eb314..d8bf4d95b8 100644
--- a/ydb/core/sys_view/service/ext_counters.cpp
+++ b/ydb/core/sys_view/service/ext_counters.cpp
@@ -21,6 +21,7 @@ class TExtCountersUpdaterActor
TCounterPtr AnonRssSize;
TCounterPtr CGroupMemLimit;
TVector<TCounterPtr> PoolElapsedMicrosec;
+ TVector<TCounterPtr> PoolCurrentThreadCount;
public:
static constexpr NKikimrServices::TActivity::EType ActorActivityType() {
@@ -64,10 +65,12 @@ private:
CGroupMemLimit = utilsGroup->FindCounter("Process/CGroupMemLimit");
PoolElapsedMicrosec.resize(Config.Pools.size());
+ PoolCurrentThreadCount.resize(Config.Pools.size());
for (size_t i = 0; i < Config.Pools.size(); ++i) {
auto poolGroup = utilsGroup->FindSubgroup("execpool", Config.Pools[i].Name);
if (poolGroup) {
PoolElapsedMicrosec[i] = poolGroup->FindCounter("ElapsedMicrosec");
+ PoolCurrentThreadCount[i] = poolGroup->FindCounter("CurrentThreadCount");
}
}
}
@@ -84,8 +87,15 @@ private:
}
for (size_t i = 0; i < Config.Pools.size(); ++i) {
if (PoolElapsedMicrosec[i]) {
- CpuUsedCorePercents[i]->Set(PoolElapsedMicrosec[i]->Val() / 10000.);
- CpuLimitCorePercents[i]->Set(Config.Pools[i].ThreadCount * 100);
+ double usedCore = PoolElapsedMicrosec[i]->Val() / 10000.;
+ CpuUsedCorePercents[i]->Set(usedCore);
+ }
+ if (PoolCurrentThreadCount[i]) {
+ double limitCore = PoolCurrentThreadCount[i]->Val() * 100;
+ CpuLimitCorePercents[i]->Set(limitCore);
+ } else {
+ double limitCore = Config.Pools[i].ThreadCount * 100;
+ CpuLimitCorePercents[i]->Set(limitCore);
}
}
}