mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
ws load test: provide stats on number of active connections
This commit is contained in:
parent
1d8eec3c44
commit
3d2ae26b13
3 changed files with 8 additions and 0 deletions
|
|
@ -92,6 +92,8 @@ impl Connection {
|
|||
);
|
||||
let (stream, _) = client_async(request, stream).await?;
|
||||
|
||||
let statistics = load_test_state.statistics.clone();
|
||||
|
||||
let mut connection = Connection {
|
||||
config,
|
||||
load_test_state,
|
||||
|
|
@ -103,12 +105,14 @@ impl Connection {
|
|||
};
|
||||
|
||||
*num_active_connections.borrow_mut() += 1;
|
||||
statistics.connections.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
if let Err(err) = connection.run_connection_loop().await {
|
||||
::log::info!("connection error: {:#}", err);
|
||||
}
|
||||
|
||||
*num_active_connections.borrow_mut() -= 1;
|
||||
statistics.connections.fetch_sub(1, Ordering::Relaxed);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue