@@ -2,7 +2,7 @@ use std::sync::Arc;
2
2
3
3
use bittorrent_tracker_core:: torrent:: repository:: in_memory:: InMemoryTorrentRepository ;
4
4
use bittorrent_udp_tracker_core:: services:: banning:: BanService ;
5
- use bittorrent_udp_tracker_core:: { self , statistics as udp_core_statistics } ;
5
+ use bittorrent_udp_tracker_core:: { self } ;
6
6
use tokio:: sync:: RwLock ;
7
7
use torrust_tracker_primitives:: swarm_metadata:: AggregateSwarmMetadata ;
8
8
use torrust_udp_tracker_server:: statistics as udp_server_statistics;
@@ -29,13 +29,11 @@ pub async fn get_metrics(
29
29
in_memory_torrent_repository : Arc < InMemoryTorrentRepository > ,
30
30
ban_service : Arc < RwLock < BanService > > ,
31
31
http_stats_repository : Arc < bittorrent_http_tracker_core:: statistics:: repository:: Repository > ,
32
- udp_core_stats_repository : Arc < udp_core_statistics:: repository:: Repository > ,
33
32
udp_server_stats_repository : Arc < udp_server_statistics:: repository:: Repository > ,
34
33
) -> TrackerMetrics {
35
34
let torrents_metrics = in_memory_torrent_repository. get_torrents_metrics ( ) ;
36
35
let udp_banned_ips_total = ban_service. read ( ) . await . get_banned_ips_total ( ) ;
37
36
let http_stats = http_stats_repository. get_stats ( ) . await ;
38
- let udp_core_stats = udp_core_stats_repository. get_stats ( ) . await ;
39
37
let udp_server_stats = udp_server_stats_repository. get_stats ( ) . await ;
40
38
41
39
// For backward compatibility we keep the `tcp4_connections_handled` and
@@ -63,16 +61,16 @@ pub async fn get_metrics(
63
61
udp_avg_scrape_processing_time_ns : udp_server_stats. udp_avg_scrape_processing_time_ns ,
64
62
// UDPv4
65
63
udp4_requests : udp_server_stats. udp4_requests ,
66
- udp4_connections_handled : udp_core_stats . udp4_connections_handled ,
67
- udp4_announces_handled : udp_core_stats . udp4_announces_handled ,
68
- udp4_scrapes_handled : udp_core_stats . udp4_scrapes_handled ,
64
+ udp4_connections_handled : udp_server_stats . udp4_connections_handled ,
65
+ udp4_announces_handled : udp_server_stats . udp4_announces_handled ,
66
+ udp4_scrapes_handled : udp_server_stats . udp4_scrapes_handled ,
69
67
udp4_responses : udp_server_stats. udp4_responses ,
70
68
udp4_errors_handled : udp_server_stats. udp4_errors_handled ,
71
69
// UDPv6
72
70
udp6_requests : udp_server_stats. udp6_requests ,
73
- udp6_connections_handled : udp_core_stats . udp6_connections_handled ,
74
- udp6_announces_handled : udp_core_stats . udp6_announces_handled ,
75
- udp6_scrapes_handled : udp_core_stats . udp6_scrapes_handled ,
71
+ udp6_connections_handled : udp_server_stats . udp6_connections_handled ,
72
+ udp6_announces_handled : udp_server_stats . udp6_announces_handled ,
73
+ udp6_scrapes_handled : udp_server_stats . udp6_scrapes_handled ,
76
74
udp6_responses : udp_server_stats. udp6_responses ,
77
75
udp6_errors_handled : udp_server_stats. udp6_errors_handled ,
78
76
} ,
@@ -112,9 +110,8 @@ mod tests {
112
110
let http_stats_repository = Arc :: new ( http_stats_repository) ;
113
111
114
112
// UDP core stats
115
- let ( _udp_stats_event_sender, udp_stats_repository ) =
113
+ let ( _udp_stats_event_sender, _udp_stats_repository ) =
116
114
bittorrent_udp_tracker_core:: statistics:: setup:: factory ( config. core . tracker_usage_statistics ) ;
117
- let udp_stats_repository = Arc :: new ( udp_stats_repository) ;
118
115
119
116
// UDP server stats
120
117
let ( _udp_server_stats_event_sender, udp_server_stats_repository) =
@@ -125,7 +122,6 @@ mod tests {
125
122
in_memory_torrent_repository. clone ( ) ,
126
123
ban_service. clone ( ) ,
127
124
http_stats_repository. clone ( ) ,
128
- udp_stats_repository. clone ( ) ,
129
125
udp_server_stats_repository. clone ( ) ,
130
126
)
131
127
. await ;
0 commit comments