From 1c634dd885cc73c444ca382d5b1f3cef3aa69416 Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Wed, 20 Feb 2019 05:59:02 +1000 Subject: [PATCH] Add metric to expose number of inflight world state requests. (#906) Signed-off-by: Adrian Sutton --- .../eth/sync/worldstate/WorldStateDownloader.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/WorldStateDownloader.java b/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/WorldStateDownloader.java index d1e9525f54..7f3f22408f 100644 --- a/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/WorldStateDownloader.java +++ b/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/worldstate/WorldStateDownloader.java @@ -93,11 +93,17 @@ public class WorldStateDownloader { this.maxOutstandingRequests = maxOutstandingRequests; this.maxNodeRequestRetries = maxNodeRequestRetries; this.ethTasksTimer = ethTasksTimer; - metricsSystem.createGauge( + metricsSystem.createLongGauge( MetricCategory.SYNCHRONIZER, "world_state_pending_requests_current", "Number of pending requests for fast sync world state download", - () -> (double) pendingRequests.size()); + pendingRequests::size); + + metricsSystem.createIntegerGauge( + MetricCategory.SYNCHRONIZER, + "world_state_inflight_requests_current", + "Number of requests currently in flight for fast sync world state download", + outstandingRequests::size); completedRequestsCounter = metricsSystem.createCounter(