From b691f48e802d0d421867e95198ea6ad32e259f5a Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Wed, 15 Dec 2021 19:56:55 +0200 Subject: [PATCH] [archiver] Update progress messages (make them shorter). --- sources/cmd/archiver/archiver.go | 10 +++++----- sources/cmd/server/server.go | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sources/cmd/archiver/archiver.go b/sources/cmd/archiver/archiver.go index d900cf9..0366b1d 100644 --- a/sources/cmd/archiver/archiver.go +++ b/sources/cmd/archiver/archiver.go @@ -444,15 +444,16 @@ func archiveReference (_context *context, _namespace string, _pathInArchive stri if _context.archivedReferences <= 1 { _context.progressLast = time.Now () } - if ((_context.archivedReferences % 1000) == 0) || (((_context.archivedReferences % 10) == 0) && (time.Since (_context.progressLast) .Seconds () >= 6)) { - log.Printf ("[ii] [5193276e] pogress -- %0.2f minutes -- %d files, %d folders, %0.2f MiB (%0.2f MiB/s) -- %d compressed (%0.2f MiB, %0.2f%%) -- %d records (%0.2f MiB)\n", + if ( + (((_context.archivedReferences % 1000) == 0) && (time.Since (_context.progressLast) .Seconds () >= 2)) || + (((_context.archivedReferences % 10) == 0) && (time.Since (_context.progressLast) .Seconds () >= 6))) { + log.Printf ("[ii] [5193276e] pogress -- %0.2f min -- %d fil, %d fol, %0.2f M (%0.2f M/s) -- %d comp, %0.2f%% -- %d rec, %0.2f M\n", time.Since (_context.progressStarted) .Minutes (), len (_context.storedFilePaths), len (_context.storedFolderPaths), float32 (_context.dataUncompressedSize) / 1024 / 1024, float64 (_context.dataUncompressedSize) / 1024 / 1024 / (time.Since (_context.progressStarted) .Seconds () + 0.001), _context.dataCompressedCount, - float32 (_context.dataUncompressedSize - _context.dataCompressedSize) / 1024 / 1024, (float32 (_context.dataUncompressedSize - _context.dataCompressedSize) / float32 (_context.dataUncompressedSize) * 100), _context.cdbWriteCount, float32 (_context.cdbWriteKeySize + _context.cdbWriteDataSize) / 1024 / 1024, @@ -1150,14 +1151,13 @@ func main_0 () (error) { } if true { - log.Printf ("[ii] [56f63575] completed -- %0.2f minutes -- %d files, %d folders, %0.2f MiB (%0.2f MiB/s) -- %d compressed (%0.2f MiB, %0.2f%%) -- %d records (%0.2f MiB)\n", + log.Printf ("[ii] [56f63575] completed -- %0.2f min -- %d fil, %d fol, %0.2f M (%0.2f M/s) -- %d comp, %0.2f%% -- %d rec, %0.2f M\n", time.Since (_context.progressStarted) .Minutes (), len (_context.storedFilePaths), len (_context.storedFolderPaths), float32 (_context.dataUncompressedSize) / 1024 / 1024, float64 (_context.dataUncompressedSize) / 1024 / 1024 / (time.Since (_context.progressStarted) .Seconds () + 0.001), _context.dataCompressedCount, - float32 (_context.dataUncompressedSize - _context.dataCompressedSize) / 1024 / 1024, (float32 (_context.dataUncompressedSize - _context.dataCompressedSize) / float32 (_context.dataUncompressedSize) * 100), _context.cdbWriteCount, float32 (_context.cdbWriteKeySize + _context.cdbWriteDataSize) / 1024 / 1024, diff --git a/sources/cmd/server/server.go b/sources/cmd/server/server.go index 400bf36..c5d22dd 100644 --- a/sources/cmd/server/server.go +++ b/sources/cmd/server/server.go @@ -440,6 +440,9 @@ func (_server *server) ServeHTTP (_response http.ResponseWriter, _request *http. func Main () () { + + log.SetPrefix (fmt.Sprintf ("[%8d] ", os.Getpid ())) + Main_0 (main_0) }