1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 07:53:00 +01: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, pub errors: usize,
/// Number of connection timeouts /// Number of connection timeouts
pub timeouts: usize, pub timeouts: usize,
/// Number of released connections
pub released: usize,
} }
#[derive(Debug)] #[derive(Debug)]
@ -904,6 +906,7 @@ impl Handler<Connect> for ClientConnector {
impl StreamHandler<AcquiredConnOperation, ()> for ClientConnector { impl StreamHandler<AcquiredConnOperation, ()> for ClientConnector {
fn handle(&mut self, msg: AcquiredConnOperation, ctx: &mut Context<Self>) { fn handle(&mut self, msg: AcquiredConnOperation, ctx: &mut Context<Self>) {
let now = Instant::now(); let now = Instant::now();
self.stats.released += 1;
// check if we have queued up waiters // check if we have queued up waiters
let waiter = { let waiter = {