Skip to content

Commit

Permalink
tiemr
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchinchilla committed Jan 9, 2025
1 parent 24cf8f9 commit 90916c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion binaries/geph5-broker/src/rpc_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ impl RpcService for WrappedBrokerService {
method: &str,
params: Vec<serde_json::Value>,
) -> Option<Result<serde_json::Value, ServerError>> {
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)
}
}

Expand Down

0 comments on commit 90916c8

Please sign in to comment.