[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/08: daemon: GC displays how much it has collected.
From: |
guix-commits |
Subject: |
02/08: daemon: GC displays how much it has collected. |
Date: |
Fri, 22 Nov 2019 09:13:55 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 732c96f182386d1be00ebf47d332d8c81b878dcf
Author: Ludovic Courtès <address@hidden>
Date: Fri Nov 22 11:33:29 2019 +0100
daemon: GC displays how much it has collected.
* nix/libstore/gc.cc (LocalStore::deletePathRecursive): Display the
percentage reached relative to 'maxFreed', or the total amount of data
deleted when 'maxFreed' is ULLONG_MAX.
---
nix/libstore/gc.cc | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc
index fe152da..7976ff7 100644
--- a/nix/libstore/gc.cc
+++ b/nix/libstore/gc.cc
@@ -11,6 +11,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <climits>
namespace nix {
@@ -417,7 +418,15 @@ void LocalStore::deletePathRecursive(GCState & state,
const Path & path)
throw SysError(format("getting status of %1%") % path);
}
- printMsg(lvlInfo, format("deleting `%1%'") % path);
+ if (state.options.maxFreed != ULLONG_MAX) {
+ double fraction = state.results.bytesFreed + size
+ / state.options.maxFreed;
+ unsigned int percentage = (fraction > 1. ? 1. : fraction) * 100.;
+ printMsg(lvlInfo, format("[%1%%%] deleting '%2%'") % percentage % path);
+ } else {
+ size_t total = (state.results.bytesFreed + size) / (1024 * 1024);
+ printMsg(lvlInfo, format("[%1% MiB] deleting '%2%'") % total % path);
+ }
state.results.paths.insert(path);
- branch master updated (4e2e84d -> cf87919), guix-commits, 2019/11/22
- 03/08: import: texlive: Handle multi-license packages., guix-commits, 2019/11/22
- 01/08: substitute: Don't fetch /nix-cache-info., guix-commits, 2019/11/22
- 02/08: daemon: GC displays how much it has collected.,
guix-commits <=
- 07/08: pack: Allow multiple '--manifest' options., guix-commits, 2019/11/22
- 05/08: profiles: Add 'concatenate-manifests'., guix-commits, 2019/11/22
- 08/08: gnu: libseccomp: Fix build on AArch64., guix-commits, 2019/11/22
- 04/08: environment: Document that '--manifest' can be repeated., guix-commits, 2019/11/22
- 06/08: package: Allow multiple '--manifest' options., guix-commits, 2019/11/22