Skip to content

Commit af2f51d

Browse files
committed
fix(volo-http): correct server handle timings
1 parent 1869c84 commit af2f51d

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

volo-http/src/server/handler.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ macro_rules! impl_handler {
7474
Ok(value) => value,
7575
Err(rejection) => return rejection.into_response(),
7676
};
77-
self($($ty,)* $last).await.into_response()
77+
cx.stats.record_handle_start();
78+
let result = self($($ty,)* $last).await;
79+
cx.stats.record_handle_finish();
80+
result.into_response()
7881
}
7982
}
8083
};

volo-http/src/server/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,14 +534,12 @@ where
534534
let mut cx = ServerContext::new(service.peer);
535535
cx.rpc_info_mut().set_config(service.config);
536536
let span = service.span_provider.on_serve(&cx);
537-
cx.stats.record_handle_start();
538537
let resp: http::Response<Body> = service
539538
.inner
540539
.call(&mut cx, req.map(Body::from_incoming))
541540
.instrument(span)
542541
.await
543542
.into_response();
544-
cx.stats.record_handle_finish();
545543
service.span_provider.leave_serve(&cx);
546544
Ok(resp)
547545
}),

0 commit comments

Comments
 (0)