aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew-rykov <arykov@ydb.tech>2023-09-28 22:42:06 +0300
committerandrew-rykov <arykov@ydb.tech>2023-09-28 23:01:51 +0300
commitaf047ff0da562d2220c693343306c4833e875040 (patch)
treeb037bf3cbe5cca9b6ab09fc341b2c0b7c8b961cb
parent2da003cff29e96d96e3cf3c5c95219cb0a55022e (diff)
downloadydb-af047ff0da562d2220c693343306c4833e875040.tar.gz
added limits to tenantinfo handler
-rw-r--r--ydb/core/viewer/json_tenantinfo.h5
-rw-r--r--ydb/core/viewer/protos/viewer.proto2
2 files changed, 7 insertions, 0 deletions
diff --git a/ydb/core/viewer/json_tenantinfo.h b/ydb/core/viewer/json_tenantinfo.h
index f2cadd2351..3bd79363b0 100644
--- a/ydb/core/viewer/json_tenantinfo.h
+++ b/ydb/core/viewer/json_tenantinfo.h
@@ -212,6 +212,8 @@ public:
resource.SetKind(unit.unit_kind());
resource.SetCount(unit.count());
}
+ Ydb::Cms::DatabaseQuotas& quotas = *tenant.MutableDatabaseQuotas();
+ quotas.MergeFrom(getTenantStatusResult.database_quotas());
RequestDone();
}
@@ -593,18 +595,21 @@ public:
if (itHiveStorageStats != HiveStorageStats.end()) {
const NKikimrHive::TEvResponseHiveStorageStats& record = itHiveStorageStats->second.Get()->Record;
uint64 storageAllocatedSize = 0;
+ uint64 storageAvailableSize = 0;
uint64 storageMinAvailableSize = std::numeric_limits<ui64>::max();
uint64 storageGroups = 0;
for (const NKikimrHive::THiveStoragePoolStats& poolStat : record.GetPools()) {
if (poolStat.GetName().StartsWith(tenantBySubDomainKey.GetName())) {
for (const NKikimrHive::THiveStorageGroupStats& groupStat : poolStat.GetGroups()) {
storageAllocatedSize += groupStat.GetAllocatedSize();
+ storageAvailableSize += groupStat.GetAvailableSize();
storageMinAvailableSize = std::min(storageMinAvailableSize, groupStat.GetAvailableSize());
++storageGroups;
}
}
}
tenant.SetStorageAllocatedSize(storageAllocatedSize);
+ tenant.SetStorageAllocatedLimit(storageAllocatedSize + storageAvailableSize);
tenant.SetStorageMinAvailableSize(storageMinAvailableSize);
tenant.SetStorageGroups(storageGroups);
}
diff --git a/ydb/core/viewer/protos/viewer.proto b/ydb/core/viewer/protos/viewer.proto
index ced9144077..255d00028d 100644
--- a/ydb/core/viewer/protos/viewer.proto
+++ b/ydb/core/viewer/protos/viewer.proto
@@ -359,6 +359,8 @@ message TTenant {
uint64 MemoryLimit = 38;
double CoresUsed = 39;
uint64 StorageGroups = 40;
+ uint64 StorageAllocatedLimit = 41;
+ Ydb.Cms.DatabaseQuotas DatabaseQuotas = 42;
}
message TTenants {