mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_udp: stop counting readable events for statistics
It is not very informative and might be expensive
This commit is contained in:
parent
90d60108c1
commit
9aa783fbb1
3 changed files with 2 additions and 18 deletions
|
|
@ -174,7 +174,6 @@ impl TorrentMaps {
|
|||
pub struct Statistics {
|
||||
pub requests_received: AtomicUsize,
|
||||
pub responses_sent: AtomicUsize,
|
||||
pub readable_events: AtomicUsize,
|
||||
pub bytes_received: AtomicUsize,
|
||||
pub bytes_sent: AtomicUsize,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,11 +93,6 @@ pub fn run_socket_worker(
|
|||
&request_sender,
|
||||
&mut local_responses,
|
||||
);
|
||||
|
||||
state
|
||||
.statistics
|
||||
.readable_events
|
||||
.fetch_add(1, Ordering::SeqCst);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,19 +41,9 @@ pub fn gather_and_print_statistics(state: &State, config: &Config) {
|
|||
let bytes_received_per_second: f64 = bytes_received / interval as f64;
|
||||
let bytes_sent_per_second: f64 = bytes_sent / interval as f64;
|
||||
|
||||
let readable_events: f64 = state
|
||||
.statistics
|
||||
.readable_events
|
||||
.fetch_and(0, Ordering::SeqCst) as f64;
|
||||
let requests_per_readable_event = if readable_events == 0.0 {
|
||||
0.0
|
||||
} else {
|
||||
requests_received / readable_events
|
||||
};
|
||||
|
||||
println!(
|
||||
"stats: {:.2} requests/second, {:.2} responses/second, {:.2} requests/readable event",
|
||||
requests_per_second, responses_per_second, requests_per_readable_event
|
||||
"stats: {:.2} requests/second, {:.2} responses/second",
|
||||
requests_per_second, responses_per_second
|
||||
);
|
||||
|
||||
println!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue