mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
udp: split statistics by ipv4/ipv6
This commit is contained in:
parent
34f263f6b9
commit
f68bbff700
4 changed files with 100 additions and 74 deletions
|
|
@ -132,9 +132,9 @@ pub fn run_request_worker(
|
|||
let peers_ipv4 = torrents.ipv4.values().map(|t| t.peers.len()).sum();
|
||||
let peers_ipv6 = torrents.ipv6.values().map(|t| t.peers.len()).sum();
|
||||
|
||||
state.statistics.peers_ipv4[worker_index.0]
|
||||
state.statistics_ipv4.peers[worker_index.0]
|
||||
.store(peers_ipv4, Ordering::Release);
|
||||
state.statistics.peers_ipv6[worker_index.0]
|
||||
state.statistics_ipv6.peers[worker_index.0]
|
||||
.store(peers_ipv6, Ordering::Release);
|
||||
}
|
||||
|
||||
|
|
@ -143,9 +143,9 @@ pub fn run_request_worker(
|
|||
if !statistics_update_interval.is_zero()
|
||||
&& now > last_statistics_update + statistics_update_interval
|
||||
{
|
||||
state.statistics.torrents_ipv4[worker_index.0]
|
||||
state.statistics_ipv4.torrents[worker_index.0]
|
||||
.store(torrents.ipv4.len(), Ordering::Release);
|
||||
state.statistics.torrents_ipv6[worker_index.0]
|
||||
state.statistics_ipv6.torrents[worker_index.0]
|
||||
.store(torrents.ipv6.len(), Ordering::Release);
|
||||
|
||||
last_statistics_update = now;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue