@@ -456,37 +456,6 @@ class TTxMonEvent_MemStateDomains : public TTransactionBase<THive> {
456456 }
457457
458458 void RenderHTMLPage (IOutputStream &out) {
459- THashMap<TSubDomainKey, size_t > tabletsRunningInObjectDomain;
460- THashMap<TSubDomainKey, size_t > tabletsRunningInOtherDomains;
461- THashMap<TSubDomainKey, size_t > tabletsTotal;
462-
463- for (const auto & [_, tablet] : Self->Tablets ) {
464- const TSubDomainKey objectDomain = tablet.ObjectDomain ;
465- ++tabletsTotal[objectDomain];
466-
467- const TNodeInfo* node = tablet.GetNode ();
468- if (node) {
469- if (node->GetServicedDomain () == objectDomain) {
470- ++tabletsRunningInObjectDomain[objectDomain];
471- } else {
472- ++tabletsRunningInOtherDomains[objectDomain];
473- }
474- }
475-
476- for (const auto & follower : tablet.Followers ) {
477- ++tabletsTotal[objectDomain];
478-
479- const TNodeInfo* followerNode = follower.GetNode ();
480- if (followerNode) {
481- if (followerNode->GetServicedDomain () == objectDomain) {
482- ++tabletsRunningInObjectDomain[objectDomain];
483- } else {
484- ++tabletsRunningInOtherDomains[objectDomain];
485- }
486- }
487- }
488- }
489-
490459 // out << "<script>$('.container').css('width', 'auto');</script>";
491460 out << " <table class='table table-sortable'>" ;
492461 out << " <thead>" ;
@@ -495,8 +464,8 @@ class TTxMonEvent_MemStateDomains : public TTransactionBase<THive> {
495464 out << " <th>Name</th>" ;
496465 out << " <th>Hive</th>" ;
497466 out << " <th>Status</th>" ;
498- out << " <th>TabletsRunningInTenantDomain </th>" ;
499- out << " <th>TabletsRunningInOtherDomains </th>" ;
467+ out << " <th>TabletsAliveInTenantDomain </th>" ;
468+ out << " <th>TabletsAliveInOtherDomains </th>" ;
500469 out << " <th>TabletsTotal</th>" ;
501470 out << " </tr>" ;
502471 out << " </thead>" ;
@@ -521,16 +490,18 @@ class TTxMonEvent_MemStateDomains : public TTransactionBase<THive> {
521490 out << " <td>-</td>" ;
522491 out << " <td>-</td>" ;
523492 }
524- if (tabletsTotal[domainKey] > 0 ) {
525- out << " <td>" << std::round (tabletsRunningInObjectDomain[domainKey] * 100.0 / tabletsTotal[domainKey]) << " %"
526- << " (" << tabletsRunningInObjectDomain[domainKey] << " of " << tabletsTotal[domainKey] << " )" << " </td>" ;
527- out << " <td>" << std::round (tabletsRunningInOtherDomains[domainKey] * 100.0 / tabletsTotal[domainKey]) << " %"
528- << " (" << tabletsRunningInOtherDomains[domainKey] << " of " << tabletsTotal[domainKey] << " )" << " </td>" ;
493+ if (Self->TabletsTotalByDomain [domainKey] > 0 ) {
494+ out << " <td>" << std::round (Self->TabletsAliveInObjectDomainByDomain [domainKey] * 100.0 / Self->TabletsTotalByDomain [domainKey]) << " %"
495+ << " (" << Self->TabletsAliveInObjectDomainByDomain [domainKey] << " of " << Self->TabletsTotalByDomain [domainKey] << " )" << " </td>" ;
496+
497+ const ui64 tabletsAliveInOtherDomains = Self->TabletsAliveByDomain [domainKey] - Self->TabletsAliveInObjectDomainByDomain [domainKey];
498+ out << " <td>" << std::round (tabletsAliveInOtherDomains * 100.0 / Self->TabletsTotalByDomain [domainKey]) << " %"
499+ << " (" << tabletsAliveInOtherDomains << " of " << Self->TabletsTotalByDomain [domainKey] << " )" << " </td>" ;
529500 } else {
530501 out << " <td>-</td>" ;
531502 out << " <td>-</td>" ;
532503 }
533- out << " <td>" << tabletsTotal [domainKey] << " </td>" ;
504+ out << " <td>" << Self-> TabletsTotalByDomain [domainKey] << " </td>" ;
534505 out << " </tr>" ;
535506 }
536507 out << " </tbody>" ;
0 commit comments