From 0d0ec431253be2c36cf37d882b97f1072ae87c93 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 28 Feb 2024 12:20:16 -0500 Subject: [PATCH] refactor: add eta to logging --- storage/storage.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/storage.go b/storage/storage.go index d90f1ea..e9270d6 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -451,8 +451,10 @@ func (s StorageServiceDefault) S3MultipartUpload(ctx context.Context, data io.Re currentAverageDuration = totalUploadDuration / time.Duration(partNum) + eta := time.Duration(int(currentAverageDuration) * (totalParts - partNum)) + s.logger.Debug("Completed part", zap.Int("partNum", partNum), zap.Int("totalParts", totalParts), zap.Uint64("partSize", partSize), zap.Int("readSize", readSize), zap.Int("size", int(size)), zap.Int("totalParts", totalParts), zap.Int("partNum", partNum), zap.String("key", key), zap.String("bucket", bucket), zap.Duration("durationMs", partDuration), - zap.Duration("currentAverageDurationMs", currentAverageDuration)) + zap.Duration("currentAverageDurationMs", currentAverageDuration), zap.Duration("eta", eta)) } // Ensure parts are ordered by part number before completing the upload