Skip to content

Commit

Permalink
Show overridden AgentParams on monitoring page (#228)
Browse files Browse the repository at this point in the history
* Show overridden AgentParams on monitoring page

* review fixes

---------

Co-authored-by: Dmitry Razumov <[email protected]>
  • Loading branch information
dvrazumov and Dmitry Razumov authored Jan 26, 2024
1 parent 3629a21 commit c35fabe
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1661,18 +1661,28 @@ void TDiskRegistryActor::RenderAgentList(
TABLE_SORTABLE_CLASS("table table-bordered") {
TABLEHEAD() {
TABLER() {
TABLEH() { out << "Name"; }
TABLEH() { out << "Value"; }
TABLEH() { out << "Agent"; }
TABLEH() { out << "RejectAgentTimeout (" << now << ")"; }
}

TABLER() {
TABLED() {
out << "RejectAgentTimeout(" << now << ")";
out << "default";
}
TABLED() {
out << State->GetRejectAgentTimeout(now, "");
}
}
for (const auto& agentId: State->GetAgentIdsWithOverriddenListParams()) {
TABLER() {
TABLED() {
out << agentId << " (overridden)";
}
TABLED() {
out << State->GetRejectAgentTimeout(now, agentId);
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,11 @@ class TDiskRegistryState
AgentList.OnAgentDisconnected(now, agentId);
}

TVector<TAgentId> GetAgentIdsWithOverriddenListParams() const
{
return AgentList.GetAgentIdsWithOverriddenListParams();
}

void SetDiskRegistryAgentListParams(
TDiskRegistryDatabase& db,
const TString& agentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,4 +604,13 @@ void TAgentList::SetDiskRegistryAgentListParams(
DiskRegistryAgentListParams[agentId] = params;
}

TVector<TString> TAgentList::GetAgentIdsWithOverriddenListParams() const
{
TVector<TAgentId> agentIds(Reserve(DiskRegistryAgentListParams.size()));
for (const auto& [agentId, _]: DiskRegistryAgentListParams) {
agentIds.push_back(agentId);
}
return agentIds;
}

} // namespace NCloud::NBlockStore::NStorage
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class TAgentList
void SetDiskRegistryAgentListParams(
const TString& agentId, const NProto::TDiskRegistryAgentParams& params);
TVector<TString> CleanupExpiredAgentListParams(TInstant now);
TVector<TString> GetAgentIdsWithOverriddenListParams() const;

private:
NProto::TAgentConfig& AddAgent(NProto::TAgentConfig config);
Expand Down

0 comments on commit c35fabe

Please sign in to comment.