diff options
author | andrew-rykov <arykov@ydb.tech> | 2023-09-28 22:42:06 +0300 |
---|---|---|
committer | andrew-rykov <arykov@ydb.tech> | 2023-09-28 23:01:51 +0300 |
commit | af047ff0da562d2220c693343306c4833e875040 (patch) | |
tree | b037bf3cbe5cca9b6ab09fc341b2c0b7c8b961cb | |
parent | 2da003cff29e96d96e3cf3c5c95219cb0a55022e (diff) | |
download | ydb-af047ff0da562d2220c693343306c4833e875040.tar.gz |
added limits to tenantinfo handler
-rw-r--r-- | ydb/core/viewer/json_tenantinfo.h | 5 | ||||
-rw-r--r-- | ydb/core/viewer/protos/viewer.proto | 2 |
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 { |