unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23979: [ER] guix gc should tell how much space it recovered
@ 2016-07-14 10:54 Vincent Legoll
  2016-07-14 11:30 ` Vincent Legoll
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Vincent Legoll @ 2016-07-14 10:54 UTC (permalink / raw)
  To: 23979

It already shows:
note: currently hard linking saves 485.41 MiB

Recovered disk space would nicely complement that.

I could be mentored to do it myself, but I'm very new to guile & guix
;-)

I'd at least require high level directions as to where I should look (in
the code) to graft that functionality.

-- 
Vincent Legoll

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23979: [ER] guix gc should tell how much space it recovered
  2016-07-14 10:54 bug#23979: [ER] guix gc should tell how much space it recovered Vincent Legoll
@ 2016-07-14 11:30 ` Vincent Legoll
  2016-07-15 14:33 ` Ludovic Courtès
  2016-07-16 12:55 ` bug#23979: Fix merged Vincent Legoll
  2 siblings, 0 replies; 7+ messages in thread
From: Vincent Legoll @ 2016-07-14 11:30 UTC (permalink / raw)
  To: 23979

Looks like I helped myself out of step 1:
this is in guix/scripts/gc.scm if I'm not mistaken

-- 
Vincent Legoll

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23979: [ER] guix gc should tell how much space it recovered
  2016-07-14 10:54 bug#23979: [ER] guix gc should tell how much space it recovered Vincent Legoll
  2016-07-14 11:30 ` Vincent Legoll
@ 2016-07-15 14:33 ` Ludovic Courtès
  2016-07-15 15:12   ` Andreas Enge
  2016-07-16 12:55 ` bug#23979: Fix merged Vincent Legoll
  2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2016-07-15 14:33 UTC (permalink / raw)
  To: Vincent Legoll; +Cc: 23979

Vincent Legoll <vincent.legoll@gmail.com> skribis:

> It already shows:
> note: currently hard linking saves 485.41 MiB
>
> Recovered disk space would nicely complement that.

Indeed.

> Looks like I helped myself out of step 1:
> this is in guix/scripts/gc.scm if I'm not mistaken

Yep, you’re on the right track!

This code calls the ‘collect-garbage’ procedure, defined in (guix
store).  You’ll see that this procedure returns two values, which are
currently ignored: the name of the items that were removed from the
store, and the number of bytes freed.

Your mission, if you accept it, is to change gc.scm to retrieve this
second value and to display it in a human-friendly way.  :-)

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23979: [ER] guix gc should tell how much space it recovered
  2016-07-15 14:33 ` Ludovic Courtès
@ 2016-07-15 15:12   ` Andreas Enge
  2016-07-15 17:06     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Enge @ 2016-07-15 15:12 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 23979

On Fri, Jul 15, 2016 at 04:33:46PM +0200, Ludovic Courtès wrote:
> This code calls the ‘collect-garbage’ procedure, defined in (guix
> store).  You’ll see that this procedure returns two values, which are
> currently ignored: the name of the items that were removed from the
> store, and the number of bytes freed.

Brutto or netto? Otherwise said, does it take into account the hardlinks
used for deduplication, or does it pretend that every deleted file saves
as much memory as its size indicates?

Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23979: [ER] guix gc should tell how much space it recovered
  2016-07-15 15:12   ` Andreas Enge
@ 2016-07-15 17:06     ` Ludovic Courtès
  2016-07-16  8:20       ` Vincent Legoll
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2016-07-15 17:06 UTC (permalink / raw)
  To: Andreas Enge; +Cc: 23979

Andreas Enge <andreas@enge.fr> skribis:

> On Fri, Jul 15, 2016 at 04:33:46PM +0200, Ludovic Courtès wrote:
>> This code calls the ‘collect-garbage’ procedure, defined in (guix
>> store).  You’ll see that this procedure returns two values, which are
>> currently ignored: the name of the items that were removed from the
>> store, and the number of bytes freed.
>
> Brutto or netto? Otherwise said, does it take into account the hardlinks
> used for deduplication, or does it pretend that every deleted file saves
> as much memory as its size indicates?

The latter, I think.  The actual computation is done by the daemon, in
libstore/gc.cc.

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23979: [ER] guix gc should tell how much space it recovered
  2016-07-15 17:06     ` Ludovic Courtès
@ 2016-07-16  8:20       ` Vincent Legoll
  0 siblings, 0 replies; 7+ messages in thread
From: Vincent Legoll @ 2016-07-16  8:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 23979

Here is an attempt:

https://lists.gnu.org/archive/html/guix-devel/2016-07/msg00574.html

I tried to use call-with-values, but couldn't make it to work so
reverted back to let-values...

To test, I added (guix-gc "-C") at the end of the script and ran "guix
pull && guile gc.scm", looked OK...

-- 
Vincent Legoll

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#23979: Fix merged
  2016-07-14 10:54 bug#23979: [ER] guix gc should tell how much space it recovered Vincent Legoll
  2016-07-14 11:30 ` Vincent Legoll
  2016-07-15 14:33 ` Ludovic Courtès
@ 2016-07-16 12:55 ` Vincent Legoll
  2 siblings, 0 replies; 7+ messages in thread
From: Vincent Legoll @ 2016-07-16 12:55 UTC (permalink / raw)
  To: 23979-done

in git commit :
1187a27112be10f2ff74144f50c88714ccf30301

following submission in :
https://lists.gnu.org/archive/html/guix-devel/2016-07/msg00574.html

Thanks for the help

-- 
Vincent Legoll

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-16 12:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 10:54 bug#23979: [ER] guix gc should tell how much space it recovered Vincent Legoll
2016-07-14 11:30 ` Vincent Legoll
2016-07-15 14:33 ` Ludovic Courtès
2016-07-15 15:12   ` Andreas Enge
2016-07-15 17:06     ` Ludovic Courtès
2016-07-16  8:20       ` Vincent Legoll
2016-07-16 12:55 ` bug#23979: Fix merged Vincent Legoll

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).