Skip to content

Commit

Permalink
add a single point of measuring timings
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianbarbu committed Sep 9, 2024
1 parent 2f51ebd commit 03f26fc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ impl RelayChainRpcClient {
hash
};

let _timer = self.metrics.as_ref().and_then(|inner| {
inner.start_request_timer(method_name, &[DURATION_LABEL_NAME, method_name])
});
let res = self
.request_tracing::<sp_core::Bytes, _>("state_call", params, |err| {
tracing::trace!(
Expand All @@ -194,10 +191,6 @@ impl RelayChainRpcClient {
where
R: DeserializeOwned + std::fmt::Debug,
{
let _timer = self
.metrics
.as_ref()
.and_then(|inner| inner.start_request_timer(method, &[DURATION_LABEL_NAME, method]));
self.request_tracing(
method,
params,
Expand All @@ -217,6 +210,11 @@ impl RelayChainRpcClient {
R: DeserializeOwned + std::fmt::Debug,
OR: Fn(&RelayChainError),
{
let _timer = self
.metrics
.as_ref()
.and_then(|inner| inner.start_request_timer(method, &[DURATION_LABEL_NAME, method]));

let (tx, rx) = futures::channel::oneshot::channel();

let message = RpcDispatcherMessage::Request(method.into(), params, tx);
Expand Down

0 comments on commit 03f26fc

Please sign in to comment.