From a9e66262aff1d44511d585c570daffc9304616c6 Mon Sep 17 00:00:00 2001 From: Bosul Mun Date: Mon, 20 Oct 2025 11:10:58 +0900 Subject: [PATCH] eth/fetcher: add metrics for tracking slow peers (#32964) This PR introduces two new metrics to monitor slow peers - One tracks the number of slow peers. - The other measures the time it takes for those peers to become "unfrozen" These metrics help with monitoring and evaluating the need for future optimization of the transaction fetcher and peer management, for example i n peer scoring and prioritization. Additionally, this PR moves the fetcher metrics into a separate file, `eth/fetcher/metrics.go`. --- eth/fetcher/metrics.go | 59 +++++++++++++++++++++++++++++++++++++++ eth/fetcher/tx_fetcher.go | 39 ++++++-------------------- 2 files changed, 68 insertions(+), 30 deletions(-) create mode 100644 eth/fetcher/metrics.go diff --git a/eth/fetcher/metrics.go b/eth/fetcher/metrics.go new file mode 100644 index 0000000000..fd1678dd30 --- /dev/null +++ b/eth/fetcher/metrics.go @@ -0,0 +1,59 @@ +// Copyright 2025 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see