* [pbs-devel] [PATCH proxmox-backup] sync: push: also log archive names and upload size
@ 2024-11-28 12:12 Christian Ebner
0 siblings, 0 replies; only message in thread
From: Christian Ebner @ 2024-11-28 12:12 UTC (permalink / raw)
To: pbs-devel
Include the archive name and upload size/rate as well, as the pull
job logs them so the absence might cause confusion.
Reported-by: Max Carrara <m.carrara@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/server/push.rs | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/server/push.rs b/src/server/push.rs
index 8f654d4b4..95c7c6bff 100644
--- a/src/server/push.rs
+++ b/src/server/push.rs
@@ -9,6 +9,8 @@ use tokio::sync::mpsc;
use tokio_stream::wrappers::ReceiverStream;
use tracing::{info, warn};
+use proxmox_human_byte::HumanByte;
+
use pbs_api_types::{
print_store_and_ns, ApiVersion, ApiVersionInfo, ArchiveType, Authid, BackupArchiveName,
BackupDir, BackupGroup, BackupGroupDeleteStats, BackupNamespace, GroupFilter, GroupListItem,
@@ -848,12 +850,20 @@ pub(crate) async fn push_snapshot(
path.push(&entry.filename);
if path.try_exists()? {
let archive_name = BackupArchiveName::from_path(&entry.filename)?;
+ log::info!("Sync archive {archive_name}");
match archive_name.archive_type() {
ArchiveType::Blob => {
let file = std::fs::File::open(path.clone())?;
let backup_stats = backup_writer
.upload_blob(file, archive_name.as_ref())
.await?;
+ log::info!(
+ "Uploaded {} ({}/s)",
+ HumanByte::from(backup_stats.size),
+ HumanByte::new_binary(
+ backup_stats.size as f64 / backup_stats.duration.as_secs_f64()
+ ),
+ );
stats.add(SyncStats {
chunk_count: backup_stats.chunk_count as usize,
bytes: backup_stats.size as usize,
@@ -883,6 +893,13 @@ pub(crate) async fn push_snapshot(
known_chunks.clone(),
)
.await?;
+ log::info!(
+ "Uploaded {} ({}/s)",
+ HumanByte::from(sync_stats.bytes),
+ HumanByte::new_binary(
+ sync_stats.bytes as f64 / sync_stats.elapsed.as_secs_f64()
+ ),
+ );
stats.add(sync_stats);
}
ArchiveType::FixedIndex => {
@@ -908,6 +925,13 @@ pub(crate) async fn push_snapshot(
known_chunks.clone(),
)
.await?;
+ log::info!(
+ "Uploaded {} ({}/s)",
+ HumanByte::from(sync_stats.bytes),
+ HumanByte::new_binary(
+ sync_stats.bytes as f64 / sync_stats.elapsed.as_secs_f64()
+ ),
+ );
stats.add(sync_stats);
}
}
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-11-28 12:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-28 12:12 [pbs-devel] [PATCH proxmox-backup] sync: push: also log archive names and upload size Christian Ebner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal