1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-08-01 18:25:04 +00:00

add release stat

This commit is contained in:
Nikolay Kim 2018-07-17 17:38:16 +06:00
parent f9f259e718
commit 373f2e5028

View file

@ -46,6 +46,8 @@ pub struct ClientConnectorStats {
pub errors: usize,
/// Number of connection timeouts
pub timeouts: usize,
/// Number of released connections
pub released: usize,
}
#[derive(Debug)]
@ -904,6 +906,7 @@ impl Handler<Connect> for ClientConnector {
impl StreamHandler<AcquiredConnOperation, ()> for ClientConnector {
fn handle(&mut self, msg: AcquiredConnOperation, ctx: &mut Context<Self>) {
let now = Instant::now();
self.stats.released += 1;
// check if we have queued up waiters
let waiter = {