@@ -3,8 +3,7 @@ use std::time::Duration;
3
3
4
4
use clap:: Parser ;
5
5
use futures:: stream:: FuturesUnordered ;
6
- use torrust_tracker:: core:: torrent:: repository:: tokio_sync:: RepositoryTokioRwLock ;
7
- use torrust_tracker:: core:: torrent:: repository:: UpdateTorrentAsync ;
6
+ use torrust_tracker:: core:: torrent:: repository:: { TorrentsTokioRwLock , UpdateTorrentAsync } ;
8
7
use torrust_tracker:: shared:: bit_torrent:: info_hash:: InfoHash ;
9
8
10
9
use crate :: args:: Args ;
@@ -13,12 +12,12 @@ use crate::benches::utils::{generate_unique_info_hashes, get_average_and_adjuste
13
12
pub async fn add_one_torrent < T > ( samples : usize ) -> ( Duration , Duration )
14
13
where
15
14
T : Default ,
16
- RepositoryTokioRwLock < T > : UpdateTorrentAsync + Default ,
15
+ TorrentsTokioRwLock < T > : UpdateTorrentAsync + Default ,
17
16
{
18
17
let mut results: Vec < Duration > = Vec :: with_capacity ( samples) ;
19
18
20
19
for _ in 0 ..samples {
21
- let torrent_repository = Arc :: new ( RepositoryTokioRwLock :: < T > :: default ( ) ) ;
20
+ let torrent_repository = Arc :: new ( TorrentsTokioRwLock :: < T > :: default ( ) ) ;
22
21
23
22
let info_hash = InfoHash ( [ 0 ; 20 ] ) ;
24
23
@@ -40,13 +39,13 @@ where
40
39
pub async fn update_one_torrent_in_parallel < T > ( runtime : & tokio:: runtime:: Runtime , samples : usize ) -> ( Duration , Duration )
41
40
where
42
41
T : Default + Send + Sync + ' static ,
43
- RepositoryTokioRwLock < T > : UpdateTorrentAsync + Default ,
42
+ TorrentsTokioRwLock < T > : UpdateTorrentAsync + Default ,
44
43
{
45
44
let args = Args :: parse ( ) ;
46
45
let mut results: Vec < Duration > = Vec :: with_capacity ( samples) ;
47
46
48
47
for _ in 0 ..samples {
49
- let torrent_repository = Arc :: new ( RepositoryTokioRwLock :: < T > :: default ( ) ) ;
48
+ let torrent_repository = Arc :: new ( TorrentsTokioRwLock :: < T > :: default ( ) ) ;
50
49
let info_hash: & ' static InfoHash = & InfoHash ( [ 0 ; 20 ] ) ;
51
50
let handles = FuturesUnordered :: new ( ) ;
52
51
@@ -90,13 +89,13 @@ where
90
89
pub async fn add_multiple_torrents_in_parallel < T > ( runtime : & tokio:: runtime:: Runtime , samples : usize ) -> ( Duration , Duration )
91
90
where
92
91
T : Default + Send + Sync + ' static ,
93
- RepositoryTokioRwLock < T > : UpdateTorrentAsync + Default ,
92
+ TorrentsTokioRwLock < T > : UpdateTorrentAsync + Default ,
94
93
{
95
94
let args = Args :: parse ( ) ;
96
95
let mut results: Vec < Duration > = Vec :: with_capacity ( samples) ;
97
96
98
97
for _ in 0 ..samples {
99
- let torrent_repository = Arc :: new ( RepositoryTokioRwLock :: < T > :: default ( ) ) ;
98
+ let torrent_repository = Arc :: new ( TorrentsTokioRwLock :: < T > :: default ( ) ) ;
100
99
let info_hashes = generate_unique_info_hashes ( 10_000 ) ;
101
100
let handles = FuturesUnordered :: new ( ) ;
102
101
@@ -135,13 +134,13 @@ where
135
134
pub async fn update_multiple_torrents_in_parallel < T > ( runtime : & tokio:: runtime:: Runtime , samples : usize ) -> ( Duration , Duration )
136
135
where
137
136
T : Default + Send + Sync + ' static ,
138
- RepositoryTokioRwLock < T > : UpdateTorrentAsync + Default ,
137
+ TorrentsTokioRwLock < T > : UpdateTorrentAsync + Default ,
139
138
{
140
139
let args = Args :: parse ( ) ;
141
140
let mut results: Vec < Duration > = Vec :: with_capacity ( samples) ;
142
141
143
142
for _ in 0 ..samples {
144
- let torrent_repository = Arc :: new ( RepositoryTokioRwLock :: < T > :: default ( ) ) ;
143
+ let torrent_repository = Arc :: new ( TorrentsTokioRwLock :: < T > :: default ( ) ) ;
145
144
let info_hashes = generate_unique_info_hashes ( 10_000 ) ;
146
145
let handles = FuturesUnordered :: new ( ) ;
147
146
0 commit comments