Add more information to our logs (#35557)
Add more logging to collab in order to help diagnose throughput issues. IMPORTANT: Do not deploy this PR without pinging me. Release Notes: - N/A --------- Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
669c57b45f
commit
6c83a3bcde
2 changed files with 61 additions and 39 deletions
|
@ -422,8 +422,26 @@ impl Peer {
|
|||
receiver_id: ConnectionId,
|
||||
request: T,
|
||||
) -> impl Future<Output = Result<T::Response>> {
|
||||
let request_start_time = Instant::now();
|
||||
let payload_type = T::NAME;
|
||||
let elapsed_time = move || request_start_time.elapsed().as_millis();
|
||||
tracing::info!(payload_type, "start forwarding request");
|
||||
self.request_internal(Some(sender_id), receiver_id, request)
|
||||
.map_ok(|envelope| envelope.payload)
|
||||
.inspect_err(move |_| {
|
||||
tracing::error!(
|
||||
waiting_for_host_ms = elapsed_time(),
|
||||
payload_type,
|
||||
"error forwarding request"
|
||||
)
|
||||
})
|
||||
.inspect_ok(move |_| {
|
||||
tracing::info!(
|
||||
waiting_for_host_ms = elapsed_time(),
|
||||
payload_type,
|
||||
"finished forwarding request"
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
fn request_internal<T: RequestMessage>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue