From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePnSN-000556-By for guix-patches@gnu.org; Fri, 15 Dec 2017 05:43:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePnSI-00058j-Av for guix-patches@gnu.org; Fri, 15 Dec 2017 05:43:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:54272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePnSI-00058T-71 for guix-patches@gnu.org; Fri, 15 Dec 2017 05:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePnSI-0004lp-0l for guix-patches@gnu.org; Fri, 15 Dec 2017 05:43:02 -0500 Subject: [bug#29699] [PATCH] guix: offload: Add "status" sub-command. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20171213224409.417-1-rekado@elephly.net> Date: Fri, 15 Dec 2017 11:42:43 +0100 In-Reply-To: <20171213224409.417-1-rekado@elephly.net> (Ricardo Wurmus's message of "Wed, 13 Dec 2017 23:44:09 +0100") Message-ID: <87lgi4jmqk.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: Ricardo Wurmus Cc: 29699@debbugs.gnu.org Ricardo Wurmus skribis: > * guix/scripts/offload.scm (check-machine-load): New procedure. > (guix-offload): Call it when the argument is "status". > * doc/guix.texi (Daemon Offload Setup): Document it. Nice, LGTM! > +(define (check-machine-load machine-file pred) > + "Print the load of each machine matching PRED in MACHINE-FILE." > + (define (build-machine=3D? m1 m2) > + (and (string=3D? (build-machine-name m1) (build-machine-name m2)) > + (=3D (build-machine-port m1) (build-machine-port m2)))) > + > + ;; A given build machine may appear several times (e.g., once for > + ;; "x86_64-linux" and a second time for "i686-linux"); test them only = once. > + (let ((machines (filter pred > + (delete-duplicates (build-machines machine-fil= e) > + build-machine=3D?)))) > + (for-each machine-load machines))) Perhaps we could also display information from =E2=80=98uname=E2=80=99, as = in ? Thanks! Ludo=E2=80=99.