diff options
author | andrew-rykov <[email protected]> | 2023-06-13 13:53:01 +0300 |
---|---|---|
committer | andrew-rykov <[email protected]> | 2023-06-13 13:53:01 +0300 |
commit | 68311764e4cf66662b9766e3e094caea2e0c9dca (patch) | |
tree | 37718d11c51f7e2c36a3356406f7c4ce9b0f1e53 | |
parent | cbaa5ef3a76c30c6f672f1ae3bfaf6d6d46e19aa (diff) |
set serverless databases status equal shared database
make serverless databases green
-rw-r--r-- | ydb/core/viewer/json_tenantinfo.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ydb/core/viewer/json_tenantinfo.h b/ydb/core/viewer/json_tenantinfo.h index 63c469f346a..5950b3d0385 100644 --- a/ydb/core/viewer/json_tenantinfo.h +++ b/ydb/core/viewer/json_tenantinfo.h @@ -381,6 +381,7 @@ public: BLOG_TRACE("ReplyAndPassAway() started"); TIntrusivePtr<TDomainsInfo> domains = AppData()->DomainsInfo; TIntrusivePtr<TDomainsInfo::TDomain> domain = domains->Domains.begin()->second; + THashMap<TString, NKikimrViewer::EFlag> OverallByDomainId; for (const auto& [subDomainKey, tenantBySubDomainKey] : TenantBySubDomainKey) { TString id(GetDomainId(subDomainKey)); NKikimrWhiteboard::TEvTabletStateResponse tabletInfo; @@ -588,6 +589,7 @@ public: } } tenant.SetOverall(overall); + OverallByDomainId[tenant.GetId()] = overall; } } for (const std::pair<const TString, NKikimrViewer::TTenant>& prTenant : TenantByPath) { @@ -604,6 +606,18 @@ public: tenant.MergeFrom(tenantByPath); tenant.SetName(path); tenant.SetOverall(overall); + if (tenant.GetId()) { + OverallByDomainId[tenant.GetId()] = overall; + } + } + for (NKikimrViewer::TTenant& tenant: *Result.MutableTenantInfo()) { + if (tenant.GetType() != NKikimrViewer::Serverless) { + continue; + } + auto it = OverallByDomainId.find(tenant.GetResourceId()); + if (it != OverallByDomainId.end()) { + tenant.SetOverall(it->second); + } } std::sort(Result.MutableTenantInfo()->begin(), Result.MutableTenantInfo()->end(), [](const NKikimrViewer::TTenant& a, const NKikimrViewer::TTenant& b) { |