From c7274dbb2cce8a5fd7491e596115c24bd76e97ba Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 22 May 2024 12:39:56 +0200 Subject: [PATCH] plugin: Track the node <> signer RTT for signer requests We have a couple of nodes that appear to have slow signers, let's check that. --- libs/gl-plugin/src/stager.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/gl-plugin/src/stager.rs b/libs/gl-plugin/src/stager.rs index 04765f70a..7e682ea16 100644 --- a/libs/gl-plugin/src/stager.rs +++ b/libs/gl-plugin/src/stager.rs @@ -23,6 +23,7 @@ pub struct Stage { pub struct Request { pub request: pb::HsmRequest, pub response: mpsc::Sender, + pub start_time: tokio::time::Instant, } impl Stage { @@ -45,7 +46,11 @@ impl Stage { mpsc::Receiver, ) = mpsc::channel(1); - let r = Request { request, response }; + let r = Request { + request, + response, + start_time: tokio::time::Instant::now(), + }; requests.insert(r.request.request_id, r.clone()); @@ -71,8 +76,9 @@ impl Stage { match requests.remove(&response.request_id) { Some(req) => { debug!( - "Response for request_id={}, outstanding requests count={}", + "Response for request_id={}, signer_rtt={}s, outstanding requests count={}", response.request_id, + req.start_time.elapsed().as_secs_f64(), requests.len() ); if let Err(e) = req.response.send(response).await {