aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzalyalov <zalyalov@yandex-team.com>2023-08-11 10:15:46 +0300
committerzalyalov <zalyalov@yandex-team.com>2023-08-11 10:54:37 +0300
commit50c9f3c5623f39d97fad522aec9f2b59f993d061 (patch)
tree5c877cf6d9e77e21b11eca315bcfd65ee872e18a
parent272a427545ac185dd72a5cae6050e608e19e022e (diff)
downloadydb-50c9f3c5623f39d97fad522aec9f2b59f993d061.tar.gz
show hive warmup in developer web ui
-rw-r--r--ydb/core/mind/hive/hive_impl.h1
-rw-r--r--ydb/core/mind/hive/hive_statics.cpp9
-rw-r--r--ydb/core/mind/hive/monitoring.cpp6
3 files changed, 13 insertions, 3 deletions
diff --git a/ydb/core/mind/hive/hive_impl.h b/ydb/core/mind/hive/hive_impl.h
index fdd83d10582..41ac9a7c059 100644
--- a/ydb/core/mind/hive/hive_impl.h
+++ b/ydb/core/mind/hive/hive_impl.h
@@ -146,6 +146,7 @@ TString GetLocationString(const NActors::TNodeLocation& location);
void MakeTabletTypeSet(std::vector<TTabletTypes::EType>& list);
bool IsValidTabletType(TTabletTypes::EType type);
TString GetBalancerProgressText(i32 balancerProgress, EBalancerType balancerType);
+TString GetRunningTabletsText(ui64 runningTablets, ui64 totalTablets, bool warmUp);
class THive : public TActor<THive>, public TTabletExecutedFlat, public THiveSharedSettings {
public:
diff --git a/ydb/core/mind/hive/hive_statics.cpp b/ydb/core/mind/hive/hive_statics.cpp
index f4c19ba58a7..c1e672ea12c 100644
--- a/ydb/core/mind/hive/hive_statics.cpp
+++ b/ydb/core/mind/hive/hive_statics.cpp
@@ -373,5 +373,14 @@ TString GetBalancerProgressText(i32 balancerProgress, EBalancerType balancerType
return str;
}
+TString GetRunningTabletsText(ui64 runningTablets, ui64 totalTablets, bool warmUp) {
+ TStringBuilder str;
+ str << (totalTablets == 0 ? 0 : runningTablets * 100 / totalTablets) << "% "<< runningTablets << "/" << totalTablets;
+ if (warmUp) {
+ str << " (Warming up...)";
+ }
+ return str;
+}
+
} // NHive
} // NKikimr
diff --git a/ydb/core/mind/hive/monitoring.cpp b/ydb/core/mind/hive/monitoring.cpp
index d5eba8979c0..d24320ece6d 100644
--- a/ydb/core/mind/hive/monitoring.cpp
+++ b/ydb/core/mind/hive/monitoring.cpp
@@ -1350,8 +1350,7 @@ public:
/*out << "<tr><td>" << "Nodes:" << "</td><td id='aliveNodes'>" << (nodes == 0 ? 0 : aliveNodes * 100 / nodes) << "% "
<< aliveNodes << "/" << nodes << "</td></tr>";*/
- out << "<tr><td>" << "Tablets:" << "</td><td id='runningTablets'>" << (tablets == 0 ? 0 : runningTablets * 100 / tablets) << "% "
- << runningTablets << "/" << tablets << "</td></tr>";
+ out << "<tr><td>" << "Tablets:" << "</td><td id='runningTablets'>" << GetRunningTabletsText(runningTablets, tablets, Self->WarmUp) << "</td></tr>";
out << "<tr><td><a role='button' data-toggle='modal' href='#rebalance'>Balancer:</a></td><td id='balancerProgress'>"
<< GetBalancerProgressText(Self->BalancerProgress, Self->LastBalancerTrigger) << "</td></tr>";
out << "<tr><td>" << "Boot Queue:" << "</td><td id='bootQueue'>" << Self->BootQueue.BootQueue.size() << "</td></tr>";
@@ -1822,7 +1821,7 @@ public:
var nlen;
try {
if ("TotalTablets" in result) {
- $('#runningTablets').html((result.TotalTablets == 0 ? 0 : Math.floor(result.RunningTablets * 100 / result.TotalTablets)) + '% ' + result.RunningTablets + '/' + result.TotalTablets);
+ $('#runningTablets').html(result.RunningTabletsText);
//$('#aliveNodes').html(result.TotalNodes == 0 ? 0 : Math.floor(result.AliveNodes * 100 / result.TotalNodes) + '% ' + result.AliveNodes + '/' + result.TotalNodes);
$('#resourceVariance').html(result.ResourceVariance);
$('#resourceTotal').html(result.ResourceTotal);
@@ -2063,6 +2062,7 @@ public:
jsonData["BalancerProgress"] = GetBalancerProgressText(Self->BalancerProgress, Self->LastBalancerTrigger);
jsonData["MaxUsage"] = GetColoredValue(stats.MaxUsage, Self->GetMaxNodeUsageToKick()) ;
jsonData["Scatter"] = GetColoredValue(stats.Scatter, Self->GetMinScatterToBalance());
+ jsonData["RunningTabletsText"] = GetRunningTabletsText(runningTablets, tablets, Self->WarmUp);
TVector<TNodeInfo*> nodeInfos;
nodeInfos.reserve(Self->Nodes.size());