@@ -456,37 +456,6 @@ class TTxMonEvent_MemStateDomains : public TTransactionBase<THive> {
456
456
}
457
457
458
458
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
-
490
459
// out << "<script>$('.container').css('width', 'auto');</script>";
491
460
out << " <table class='table table-sortable'>" ;
492
461
out << " <thead>" ;
@@ -495,8 +464,8 @@ class TTxMonEvent_MemStateDomains : public TTransactionBase<THive> {
495
464
out << " <th>Name</th>" ;
496
465
out << " <th>Hive</th>" ;
497
466
out << " <th>Status</th>" ;
498
- out << " <th>TabletsRunningInTenantDomain </th>" ;
499
- out << " <th>TabletsRunningInOtherDomains </th>" ;
467
+ out << " <th>TabletsAliveInTenantDomain </th>" ;
468
+ out << " <th>TabletsAliveInOtherDomains </th>" ;
500
469
out << " <th>TabletsTotal</th>" ;
501
470
out << " </tr>" ;
502
471
out << " </thead>" ;
@@ -521,16 +490,18 @@ class TTxMonEvent_MemStateDomains : public TTransactionBase<THive> {
521
490
out << " <td>-</td>" ;
522
491
out << " <td>-</td>" ;
523
492
}
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>" ;
529
500
} else {
530
501
out << " <td>-</td>" ;
531
502
out << " <td>-</td>" ;
532
503
}
533
- out << " <td>" << tabletsTotal [domainKey] << " </td>" ;
504
+ out << " <td>" << Self-> TabletsTotalByDomain [domainKey] << " </td>" ;
534
505
out << " </tr>" ;
535
506
}
536
507
out << " </tbody>" ;
0 commit comments