From 2c10410b0d397eb5736e4cd1a231f3ce5a06f097 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 11 Mar 2021 08:43:13 +0100 Subject: [PATCH] tape: improve backup task log --- src/api2/tape/backup.rs | 6 +++--- src/tape/pool_writer.rs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs index 58b3ab1d..17eed23e 100644 --- a/src/api2/tape/backup.rs +++ b/src/api2/tape/backup.rs @@ -417,9 +417,9 @@ fn backup_worker( progress.group_snapshots = 1; if let Some(info) = snapshot_list.pop() { if pool_writer.contains_snapshot(&info.backup_dir.to_string()) { + task_log!(worker, "skip snapshot {}", info.backup_dir); continue; } - task_log!(worker, "backup snapshot {}", info.backup_dir); if !backup_snapshot(worker, &mut pool_writer, datastore.clone(), info.backup_dir)? { errors = true; } @@ -434,9 +434,9 @@ fn backup_worker( progress.group_snapshots = snapshot_list.len() as u64; for (snapshot_number, info) in snapshot_list.into_iter().enumerate() { if pool_writer.contains_snapshot(&info.backup_dir.to_string()) { + task_log!(worker, "skip snapshot {}", info.backup_dir); continue; } - task_log!(worker, "backup snapshot {}", info.backup_dir); if !backup_snapshot(worker, &mut pool_writer, datastore.clone(), info.backup_dir)? { errors = true; } @@ -497,7 +497,7 @@ pub fn backup_snapshot( snapshot: BackupDir, ) -> Result { - task_log!(worker, "start backup {}:{}", datastore.name(), snapshot); + task_log!(worker, "backup snapshot {}", snapshot); let snapshot_reader = match SnapshotReader::new(datastore.clone(), snapshot.clone()) { Ok(reader) => reader, diff --git a/src/tape/pool_writer.rs b/src/tape/pool_writer.rs index 15c4b054..e2ff9bd7 100644 --- a/src/tape/pool_writer.rs +++ b/src/tape/pool_writer.rs @@ -374,7 +374,8 @@ impl PoolWriter { let elapsed = start_time.elapsed()?.as_secs_f64(); worker.log(format!( - "wrote {:.2} MB ({:.2} MB/s)", + "wrote {} chunks ({:.2} MiB at {:.2} MiB/s)", + saved_chunks.len(), bytes_written as f64 / (1024.0*1024.0), (bytes_written as f64)/(1024.0*1024.0*elapsed), )); @@ -398,7 +399,7 @@ impl PoolWriter { /// write up to of chunks fn write_chunk_archive<'a>( - worker: &WorkerTask, + _worker: &WorkerTask, writer: Box, datastore: &DataStore, chunk_iter: &mut std::iter::Peekable, @@ -444,7 +445,7 @@ fn write_chunk_archive<'a>( } if writer.bytes_written() > max_size { - worker.log("Chunk Archive max size reached, closing archive".to_string()); + //worker.log("Chunk Archive max size reached, closing archive".to_string()); break; } }