@@ -535,6 +535,18 @@ class TJsonTenantInfo : public TViewerPipeClient {
535
535
return NKikimrViewer::TStorageUsage::None;
536
536
}
537
537
538
+ NKikimrViewer::TStorageUsage::EType GuessStorageType (const NKikimrSubDomains::TDomainDescription& domainDescription) {
539
+ NKikimrViewer::TStorageUsage::EType type = NKikimrViewer::TStorageUsage::SSD;
540
+ for (const auto & pool : domainDescription.GetStoragePools ()) {
541
+ auto poolType = GetStorageType (pool.GetKind ());
542
+ if (poolType != NKikimrViewer::TStorageUsage::None) {
543
+ type = poolType;
544
+ break ;
545
+ }
546
+ }
547
+ return type;
548
+ }
549
+
538
550
void ReplyAndPassAway () override {
539
551
BLOG_TRACE (" ReplyAndPassAway() started" );
540
552
TIntrusivePtr<TDomainsInfo> domains = AppData ()->DomainsInfo ;
@@ -693,12 +705,6 @@ class TJsonTenantInfo : public TViewerPipeClient {
693
705
694
706
THashMap<NKikimrViewer::TStorageUsage::EType, ui64> storageUsageByType;
695
707
THashMap<NKikimrViewer::TStorageUsage::EType, TStorageQuota> storageQuotasByType;
696
- if (entry.DomainDescription ) {
697
- for (const auto & poolUsage : entry.DomainDescription ->Description .GetDiskSpaceUsage ().GetStoragePoolsUsage ()) {
698
- auto type = GetStorageType (poolUsage.GetPoolKind ());
699
- storageUsageByType[type] += poolUsage.GetTotalSize ();
700
- }
701
- }
702
708
703
709
for (const auto & quota : tenant.GetDatabaseQuotas ().storage_quotas ()) {
704
710
auto type = GetStorageType (quota.unit_kind ());
@@ -707,6 +713,24 @@ class TJsonTenantInfo : public TViewerPipeClient {
707
713
usage.HardQuota += quota.data_size_hard_quota ();
708
714
}
709
715
716
+ if (entry.DomainDescription ) {
717
+ for (const auto & poolUsage : entry.DomainDescription ->Description .GetDiskSpaceUsage ().GetStoragePoolsUsage ()) {
718
+ auto type = GetStorageType (poolUsage.GetPoolKind ());
719
+ storageUsageByType[type] += poolUsage.GetTotalSize ();
720
+ }
721
+
722
+ if (storageUsageByType.empty () && entry.DomainDescription ->Description .HasDiskSpaceUsage ()) {
723
+ storageUsageByType[GuessStorageType (entry.DomainDescription ->Description )] =
724
+ entry.DomainDescription ->Description .GetDiskSpaceUsage ().GetTables ().GetTotalSize ();
725
+ }
726
+
727
+ if (storageQuotasByType.empty ()) {
728
+ auto & quotas = storageQuotasByType[GuessStorageType (entry.DomainDescription ->Description )];
729
+ quotas.HardQuota = entry.DomainDescription ->Description .GetDatabaseQuotas ().data_size_hard_quota ();
730
+ quotas.SoftQuota = entry.DomainDescription ->Description .GetDatabaseQuotas ().data_size_soft_quota ();
731
+ }
732
+ }
733
+
710
734
for (const auto & [type, size] : storageUsageByType) {
711
735
auto & storageUsage = *tenant.AddStorageUsage ();
712
736
storageUsage.SetType (type);
0 commit comments