@@ -25,7 +25,7 @@ pub enum TrackerStatisticsEvent {
2525}
2626
2727#[ derive( Debug ) ]
28- pub struct TrackerStatistics {
28+ pub struct Metrics {
2929 pub tcp4_connections_handled : u64 ,
3030 pub tcp4_announces_handled : u64 ,
3131 pub tcp4_scrapes_handled : u64 ,
@@ -40,13 +40,13 @@ pub struct TrackerStatistics {
4040 pub udp6_scrapes_handled : u64 ,
4141}
4242
43- impl Default for TrackerStatistics {
43+ impl Default for Metrics {
4444 fn default ( ) -> Self {
4545 Self :: new ( )
4646 }
4747}
4848
49- impl TrackerStatistics {
49+ impl Metrics {
5050 #[ must_use]
5151 pub fn new ( ) -> Self {
5252 Self {
@@ -177,7 +177,7 @@ impl TrackerStatisticsEventSender for StatsEventSender {
177177
178178#[ derive( Clone ) ]
179179pub struct StatsRepository {
180- pub stats : Arc < RwLock < TrackerStatistics > > ,
180+ pub stats : Arc < RwLock < Metrics > > ,
181181}
182182
183183impl Default for StatsRepository {
@@ -190,11 +190,11 @@ impl StatsRepository {
190190 #[ must_use]
191191 pub fn new ( ) -> Self {
192192 Self {
193- stats : Arc :: new ( RwLock :: new ( TrackerStatistics :: new ( ) ) ) ,
193+ stats : Arc :: new ( RwLock :: new ( Metrics :: new ( ) ) ) ,
194194 }
195195 }
196196
197- pub async fn get_stats ( & self ) -> RwLockReadGuard < ' _ , TrackerStatistics > {
197+ pub async fn get_stats ( & self ) -> RwLockReadGuard < ' _ , Metrics > {
198198 self . stats . read ( ) . await
199199 }
200200
@@ -275,15 +275,15 @@ impl StatsRepository {
275275mod tests {
276276
277277 mod stats_tracker {
278- use crate :: tracker:: statistics:: { StatsTracker , TrackerStatistics , TrackerStatisticsEvent } ;
278+ use crate :: tracker:: statistics:: { Metrics , StatsTracker , TrackerStatisticsEvent } ;
279279
280280 #[ tokio:: test]
281281 async fn should_contain_the_tracker_statistics ( ) {
282282 let stats_tracker = StatsTracker :: new ( ) ;
283283
284284 let stats = stats_tracker. stats_repository . get_stats ( ) . await ;
285285
286- assert_eq ! ( stats. tcp4_announces_handled, TrackerStatistics :: new( ) . tcp4_announces_handled) ;
286+ assert_eq ! ( stats. tcp4_announces_handled, Metrics :: new( ) . tcp4_announces_handled) ;
287287 }
288288
289289 #[ tokio:: test]
0 commit comments