diff --git a/binaries/geph5-broker/src/rpc_impl.rs b/binaries/geph5-broker/src/rpc_impl.rs index f880c34..e5f2b94 100644 --- a/binaries/geph5-broker/src/rpc_impl.rs +++ b/binaries/geph5-broker/src/rpc_impl.rs @@ -44,10 +44,15 @@ impl RpcService for WrappedBrokerService { method: &str, params: Vec, ) -> Option> { + let start = Instant::now(); + let resp = self.0.respond(method, params).await?; if let Some(client) = STATSD_CLIENT.as_ref() { client.count(&format!("broker.{method}"), 1).unwrap(); + client + .time(&format!("broker_resptime.{method}"), start.elapsed()) + .unwrap(); } - self.0.respond(method, params).await + Some(resp) } }