Skip to content

Commit

Permalink
added version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
StekPerepolnen committed Aug 12, 2024
1 parent f0995a9 commit 8b88561
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ydb/core/viewer/json_handlers_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void InitViewerHiveStatsJsonHandler(TJsonHandlers& handlers) {
}

void InitViewerTenantInfoJsonHandler(TJsonHandlers &handlers) {
handlers.AddHandler("/viewer/tenantinfo", new TJsonHandler<TJsonTenantInfo>(TJsonTenantInfo::GetSwagger()));
handlers.AddHandler("/viewer/tenantinfo", new TJsonHandler<TJsonTenantInfo>(TJsonTenantInfo::GetSwagger()), 2);
}

void InitViewerWhoAmIJsonHandler(TJsonHandlers& handlers) {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/viewer/protos/viewer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ message TTenants {
message TTenantInfo {
repeated TTenant TenantInfo = 1;
repeated string Errors = 2;
uint32 Version = 3;
}

message TStoragePDisk {
Expand Down
9 changes: 5 additions & 4 deletions ydb/core/viewer/viewer_tenantinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ class TJsonTenantInfo : public TViewerPipeClient {

void ReplyAndPassAway() override {
BLOG_TRACE("ReplyAndPassAway() started");
Result.SetVersion(2);
TIntrusivePtr<TDomainsInfo> domains = AppData()->DomainsInfo;
auto *domain = domains->GetDomain();
THashMap<TString, NKikimrViewer::EFlag> OverallByDomainId;
Expand Down Expand Up @@ -752,10 +753,10 @@ class TJsonTenantInfo : public TViewerPipeClient {

for (const auto& [type, size] : tablesStorageByType) {
auto it = storageQuotasByType.find(type);
if (it != storageQuotasByType.end() && it->second.SoftQuota) {
auto& tablesStorage = *tenant.AddTablesStorage();
tablesStorage.SetType(type);
tablesStorage.SetSize(size);
auto& tablesStorage = *tenant.AddTablesStorage();
tablesStorage.SetType(type);
tablesStorage.SetSize(size);
if (it != storageQuotasByType.end()) {
tablesStorage.SetLimit(it->second.SoftQuota);
tablesStorage.SetSoftQuota(it->second.SoftQuota);
tablesStorage.SetHardQuota(it->second.HardQuota);
Expand Down

0 comments on commit 8b88561

Please sign in to comment.