@@ -6,21 +6,17 @@ pub async fn handle_event(event: Event, stats_repository: &Repository) {
6
6
// TCP4
7
7
Event :: Tcp4Announce => {
8
8
stats_repository. increase_tcp4_announces ( ) . await ;
9
- stats_repository. increase_tcp4_connections ( ) . await ;
10
9
}
11
10
Event :: Tcp4Scrape => {
12
11
stats_repository. increase_tcp4_scrapes ( ) . await ;
13
- stats_repository. increase_tcp4_connections ( ) . await ;
14
12
}
15
13
16
14
// TCP6
17
15
Event :: Tcp6Announce => {
18
16
stats_repository. increase_tcp6_announces ( ) . await ;
19
- stats_repository. increase_tcp6_connections ( ) . await ;
20
17
}
21
18
Event :: Tcp6Scrape => {
22
19
stats_repository. increase_tcp6_scrapes ( ) . await ;
23
- stats_repository. increase_tcp6_connections ( ) . await ;
24
20
}
25
21
}
26
22
@@ -44,17 +40,6 @@ mod tests {
44
40
assert_eq ! ( stats. tcp4_announces_handled, 1 ) ;
45
41
}
46
42
47
- #[ tokio:: test]
48
- async fn should_increase_the_tcp4_connections_counter_when_it_receives_a_tcp4_announce_event ( ) {
49
- let stats_repository = Repository :: new ( ) ;
50
-
51
- handle_event ( Event :: Tcp4Announce , & stats_repository) . await ;
52
-
53
- let stats = stats_repository. get_stats ( ) . await ;
54
-
55
- assert_eq ! ( stats. tcp4_connections_handled, 1 ) ;
56
- }
57
-
58
43
#[ tokio:: test]
59
44
async fn should_increase_the_tcp4_scrapes_counter_when_it_receives_a_tcp4_scrape_event ( ) {
60
45
let stats_repository = Repository :: new ( ) ;
@@ -66,17 +51,6 @@ mod tests {
66
51
assert_eq ! ( stats. tcp4_scrapes_handled, 1 ) ;
67
52
}
68
53
69
- #[ tokio:: test]
70
- async fn should_increase_the_tcp4_connections_counter_when_it_receives_a_tcp4_scrape_event ( ) {
71
- let stats_repository = Repository :: new ( ) ;
72
-
73
- handle_event ( Event :: Tcp4Scrape , & stats_repository) . await ;
74
-
75
- let stats = stats_repository. get_stats ( ) . await ;
76
-
77
- assert_eq ! ( stats. tcp4_connections_handled, 1 ) ;
78
- }
79
-
80
54
#[ tokio:: test]
81
55
async fn should_increase_the_tcp6_announces_counter_when_it_receives_a_tcp6_announce_event ( ) {
82
56
let stats_repository = Repository :: new ( ) ;
@@ -88,17 +62,6 @@ mod tests {
88
62
assert_eq ! ( stats. tcp6_announces_handled, 1 ) ;
89
63
}
90
64
91
- #[ tokio:: test]
92
- async fn should_increase_the_tcp6_connections_counter_when_it_receives_a_tcp6_announce_event ( ) {
93
- let stats_repository = Repository :: new ( ) ;
94
-
95
- handle_event ( Event :: Tcp6Announce , & stats_repository) . await ;
96
-
97
- let stats = stats_repository. get_stats ( ) . await ;
98
-
99
- assert_eq ! ( stats. tcp6_connections_handled, 1 ) ;
100
- }
101
-
102
65
#[ tokio:: test]
103
66
async fn should_increase_the_tcp6_scrapes_counter_when_it_receives_a_tcp6_scrape_event ( ) {
104
67
let stats_repository = Repository :: new ( ) ;
@@ -109,15 +72,4 @@ mod tests {
109
72
110
73
assert_eq ! ( stats. tcp6_scrapes_handled, 1 ) ;
111
74
}
112
-
113
- #[ tokio:: test]
114
- async fn should_increase_the_tcp6_connections_counter_when_it_receives_a_tcp6_scrape_event ( ) {
115
- let stats_repository = Repository :: new ( ) ;
116
-
117
- handle_event ( Event :: Tcp6Scrape , & stats_repository) . await ;
118
-
119
- let stats = stats_repository. get_stats ( ) . await ;
120
-
121
- assert_eq ! ( stats. tcp6_connections_handled, 1 ) ;
122
- }
123
75
}
0 commit comments