From c35fabe9ac13c430a87eaef64d68760e3909ecf0 Mon Sep 17 00:00:00 2001 From: Dmitry Razumov Date: Fri, 26 Jan 2024 12:41:52 +0100 Subject: [PATCH] Show overridden AgentParams on monitoring page (#228) * Show overridden AgentParams on monitoring page * review fixes --------- Co-authored-by: Dmitry Razumov --- .../disk_registry_actor_monitoring.cpp | 16 +++++++++++++--- .../storage/disk_registry/disk_registry_state.h | 5 +++++ .../storage/disk_registry/model/agent_list.cpp | 9 +++++++++ .../storage/disk_registry/model/agent_list.h | 1 + 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/cloud/blockstore/libs/storage/disk_registry/disk_registry_actor_monitoring.cpp b/cloud/blockstore/libs/storage/disk_registry/disk_registry_actor_monitoring.cpp index cf040c1042c..e96c766ca61 100644 --- a/cloud/blockstore/libs/storage/disk_registry/disk_registry_actor_monitoring.cpp +++ b/cloud/blockstore/libs/storage/disk_registry/disk_registry_actor_monitoring.cpp @@ -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); + } + } + } } } } diff --git a/cloud/blockstore/libs/storage/disk_registry/disk_registry_state.h b/cloud/blockstore/libs/storage/disk_registry/disk_registry_state.h index 848a524e06f..b7c965333d9 100644 --- a/cloud/blockstore/libs/storage/disk_registry/disk_registry_state.h +++ b/cloud/blockstore/libs/storage/disk_registry/disk_registry_state.h @@ -800,6 +800,11 @@ class TDiskRegistryState AgentList.OnAgentDisconnected(now, agentId); } + TVector GetAgentIdsWithOverriddenListParams() const + { + return AgentList.GetAgentIdsWithOverriddenListParams(); + } + void SetDiskRegistryAgentListParams( TDiskRegistryDatabase& db, const TString& agentId, diff --git a/cloud/blockstore/libs/storage/disk_registry/model/agent_list.cpp b/cloud/blockstore/libs/storage/disk_registry/model/agent_list.cpp index 7f3775e782c..c73aeb8fd2d 100644 --- a/cloud/blockstore/libs/storage/disk_registry/model/agent_list.cpp +++ b/cloud/blockstore/libs/storage/disk_registry/model/agent_list.cpp @@ -604,4 +604,13 @@ void TAgentList::SetDiskRegistryAgentListParams( DiskRegistryAgentListParams[agentId] = params; } +TVector TAgentList::GetAgentIdsWithOverriddenListParams() const +{ + TVector agentIds(Reserve(DiskRegistryAgentListParams.size())); + for (const auto& [agentId, _]: DiskRegistryAgentListParams) { + agentIds.push_back(agentId); + } + return agentIds; +} + } // namespace NCloud::NBlockStore::NStorage diff --git a/cloud/blockstore/libs/storage/disk_registry/model/agent_list.h b/cloud/blockstore/libs/storage/disk_registry/model/agent_list.h index d4d916b8d1a..1cc30eea382 100644 --- a/cloud/blockstore/libs/storage/disk_registry/model/agent_list.h +++ b/cloud/blockstore/libs/storage/disk_registry/model/agent_list.h @@ -119,6 +119,7 @@ class TAgentList void SetDiskRegistryAgentListParams( const TString& agentId, const NProto::TDiskRegistryAgentParams& params); TVector CleanupExpiredAgentListParams(TInstant now); + TVector GetAgentIdsWithOverriddenListParams() const; private: NProto::TAgentConfig& AddAgent(NProto::TAgentConfig config);