Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show exclusive nodes in embedded ui KIKIMR-20675 #1149

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ydb/core/viewer/json_compute.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ class TJsonCompute : public TViewerPipeClient<TJsonCompute> {
for (const NKikimrHive::THiveNodeStats& nodeStat : nodeStats) {
auto nodeId = nodeStat.GetNodeId();
if (IsRequiredNode(nodeId)) {
const auto& nodeDomain = nodeStat.GetNodeDomain();
const TPathId subDomain(nodeDomain.GetSchemeShard(), nodeDomain.GetPathId());
if (FilterSubDomain && FilterSubDomain != subDomain) {
continue;
}
NodeIds.emplace_back(nodeId); // order is important
TActorId whiteboardServiceId = MakeNodeWhiteboardServiceId(nodeId);
THolder<NNodeWhiteboard::TEvWhiteboard::TEvSystemStateRequest> request = MakeHolder<NNodeWhiteboard::TEvWhiteboard::TEvSystemStateRequest>();
Expand Down
16 changes: 15 additions & 1 deletion ydb/core/viewer/json_nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
TJsonSettings JsonSettings;
ui32 Timeout = 0;
TString FilterTenant;
TSubDomainKey FilterSubDomainKey;
TString FilterPath;
TString FilterStoragePool;
std::unordered_set<TNodeId> FilterNodeIds;
Expand Down Expand Up @@ -405,6 +406,11 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
if (HiveId == 0) {
HiveId = entry.DomainInfo->Params.GetHive();
}
if (!FilterSubDomainKey) {
const auto ownerId = entry.DomainInfo->DomainKey.OwnerId;
const auto localPathId = entry.DomainInfo->DomainKey.LocalPathId;
FilterSubDomainKey = TSubDomainKey(ownerId, localPathId);
}
if (entry.DomainInfo->ResourcesDomainKey && entry.DomainInfo->DomainKey != entry.DomainInfo->ResourcesDomainKey) {
TPathId resourceDomainKey(entry.DomainInfo->ResourcesDomainKey);
BLOG_TRACE("Requesting navigate for resource domain " << resourceDomainKey);
Expand Down Expand Up @@ -461,6 +467,10 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
void Handle(TEvHive::TEvResponseHiveNodeStats::TPtr& ev) {
BLOG_TRACE("ResponseHiveNodeStats()");
for (const NKikimrHive::THiveNodeStats& nodeStats : ev->Get()->Record.GetNodeStats()) {
const TSubDomainKey nodeSubDomainKey = TSubDomainKey(nodeStats.GetNodeDomain());
if (FilterSubDomainKey && FilterSubDomainKey != nodeSubDomainKey) {
continue;
}
ui32 nodeId = nodeStats.GetNodeId();
auto& tabletInfo(TabletInfo[nodeId]);
for (const NKikimrHive::THiveDomainStatsStateCount& stateStats : nodeStats.GetStateStats()) {
Expand Down Expand Up @@ -514,14 +524,18 @@ class TJsonNodes : public TViewerPipeClient<TJsonNodes> {
}

void Handle(TEvStateStorage::TEvBoardInfo::TPtr& ev) {
BLOG_TRACE("Received TEvBoardInfo");
if (ev->Get()->Status == TEvStateStorage::TEvBoardInfo::EStatus::Ok) {
BLOG_TRACE("Received TEvBoardInfo");
for (const auto& [actorId, infoEntry] : ev->Get()->InfoEntries) {
auto nodeId(actorId.NodeId());
BLOG_TRACE("BoardInfo filter node by " << nodeId);
FilterNodeIds.insert(nodeId);
}
} else {
BLOG_TRACE("Error receiving TEvBoardInfo response");
FilterNodeIds = { 0 };
}

if (--RequestsBeforeNodeList == 0) {
ProcessNodeIds();
}
Expand Down
9 changes: 6 additions & 3 deletions ydb/core/viewer/json_tenantinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,12 @@ class TJsonTenantInfo : public TViewerPipeClient<TJsonTenantInfo> {

if (tenant.GetType() == NKikimrViewer::Serverless) {
tenant.SetStorageAllocatedSize(tenant.GetMetrics().GetStorage());
tenant.SetMemoryUsed(tenant.GetMetrics().GetMemory());
tenant.ClearMemoryLimit();
tenant.SetCoresUsed(static_cast<double>(tenant.GetMetrics().GetCPU()) / 1000000);
const bool noExclusiveNodes = tenantNodes.empty();
if (noExclusiveNodes) {
tenant.SetMemoryUsed(tenant.GetMetrics().GetMemory());
tenant.ClearMemoryLimit();
tenant.SetCoresUsed(static_cast<double>(tenant.GetMetrics().GetCPU()) / 1000000);
}
}

if (Tablets) {
Expand Down
Loading
Loading