From b7935f77fcb1149e8797d5bec9c65840e2109458 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 19 Jun 2023 17:46:58 -0700 Subject: [PATCH] spawn recording latency --- web3_proxy/src/rpcs/request.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web3_proxy/src/rpcs/request.rs b/web3_proxy/src/rpcs/request.rs index d6cfa951..7cbcffc6 100644 --- a/web3_proxy/src/rpcs/request.rs +++ b/web3_proxy/src/rpcs/request.rs @@ -381,9 +381,10 @@ impl OpenRequestHandle { } } - // TODO: benchmark spawning both of these - self.rpc.peak_latency.as_ref().unwrap().report(latency); - self.rpc.median_latency.as_ref().unwrap().record(latency); + tokio::spawn(async move { + self.rpc.peak_latency.as_ref().unwrap().report(latency); + self.rpc.median_latency.as_ref().unwrap().record(latency); + }); response }