From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59747) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5z0l-0003g2-Ie for guix-patches@gnu.org; Sun, 23 Feb 2020 16:42:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5z0k-0004RI-Kj for guix-patches@gnu.org; Sun, 23 Feb 2020 16:42:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45704) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5z0k-0004RC-Hb for guix-patches@gnu.org; Sun, 23 Feb 2020 16:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j5z0k-0001fe-FL for guix-patches@gnu.org; Sun, 23 Feb 2020 16:42:02 -0500 Subject: [bug#39734] [PATCH] scripts: Emit GC hint if free space is lower than absolute and relative threshold. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200222104653.1324-1-mail@ambrevar.xyz> <874kvizxi6.fsf@gnu.org> <87tv3ig8bc.fsf@ambrevar.xyz> <87h7zhttk1.fsf@gnu.org> <874kvhfrqk.fsf@ambrevar.xyz> <875zfxtlrk.fsf@gnu.org> <87pne5e581.fsf@ambrevar.xyz> <87tv3hs2u0.fsf@gnu.org> <87ftf1dnfj.fsf@ambrevar.xyz> Date: Sun, 23 Feb 2020 22:40:56 +0100 In-Reply-To: <87ftf1dnfj.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Sun, 23 Feb 2020 22:05:36 +0100") Message-ID: <87lfotnfrr.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Pierre Neidhardt Cc: 39734@debbugs.gnu.org Pierre Neidhardt skribis: > Ludovic Court=C3=A8s writes: > >> So back to the original patch=E2=80=A6 I think we should use =E2=80=98si= ze->number=E2=80=99 for >> the absolute threshold. >> >> I=E2=80=99m also still mildly reluctant to the addition of >> =E2=80=98GUIX_DISK_SPACE_WARNING_ABSOLUTE=E2=80=99 (one more variable an= d a weird >> name=E2=80=94=E2=80=9Cabsolute warning=E2=80=9D?). An option could be t= o allow >> =E2=80=98GUIX_DISK_SPACE_WARNING=E2=80=99 to optionally contain both thr= esholds. These >> would be valid values: >> >> 1GiB;10% >> 15 ;15% relative, and default absolute >> 15% ;same >> 1G ;1G absolute, and default relative > > The above logic implies that we test against size->number, and if it > fails then we set the relative threshold. > > But a size->number quits Guile. More precisely, it throws a 'quit exception. :-) So you could always do: (false-if-exception (size->number x)). HTH, Ludo=E2=80=99.