Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: Track signer <> node RTT for signer requests #451

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions libs/gl-plugin/src/stager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct Stage {
pub struct Request {
pub request: pb::HsmRequest,
pub response: mpsc::Sender<pb::HsmResponse>,
pub start_time: tokio::time::Instant,
}

impl Stage {
Expand All @@ -45,7 +46,11 @@ impl Stage {
mpsc::Receiver<pb::HsmResponse>,
) = 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());

Expand All @@ -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 {
Expand Down
Loading