]>
git.proxmox.com Git - proxmox-backup.git/blob - src/bin/upload-speed.rs
3 use proxmox_backup
::client
::*;
5 async
fn upload_speed() -> Result
<usize, Error
> {
7 let host
= "localhost";
8 let datastore
= "store2";
10 let username
= "root@pam";
12 let client
= HttpClient
::new(host
, username
, None
)?
;
14 let backup_time
= chrono
::Utc
::now();
16 let client
= BackupWriter
::start(client
, datastore
, "host", "speedtest", backup_time
, false).await?
;
18 println
!("start upload speed test");
19 let res
= client
.upload_speedtest().await?
;
26 match upload_speed().await
{
28 println
!("average upload speed: {} MB/s", mbs
);
31 eprintln
!("ERROR: {}", err
);