3 use pbs_client
::{HttpClient, HttpClientOptions, BackupWriter}
;
4 use pbs_api_types
::Authid
;
6 async
fn upload_speed() -> Result
<f64, Error
> {
8 let host
= "localhost";
9 let datastore
= "store2";
11 let auth_id
= Authid
::root_auth_id();
13 let options
= HttpClientOptions
::default()
17 let client
= HttpClient
::new(host
, 8007, auth_id
, options
)?
;
19 let backup_time
= proxmox_time
::epoch_i64();
21 let client
= BackupWriter
::start(client
, None
, datastore
, "host", "speedtest", backup_time
, false, true).await?
;
23 println
!("start upload speed test");
24 let res
= client
.upload_speedtest(true).await?
;
30 match proxmox_async
::runtime
::main(upload_speed()) {
32 println
!("average upload speed: {} MB/s", mbs
);
35 eprintln
!("ERROR: {}", err
);