[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#29699] [PATCH] guix: offload: Add "status" sub-command.
From: |
Ludovic Courtès |
Subject: |
[bug#29699] [PATCH] guix: offload: Add "status" sub-command. |
Date: |
Fri, 15 Dec 2017 11:42:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Ricardo Wurmus <address@hidden> 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=? m1 m2)
> + (and (string=? (build-machine-name m1) (build-machine-name m2))
> + (= (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-file)
> + build-machine=?))))
> + (for-each machine-load machines)))
Perhaps we could also display information from ‘uname’, as in
<https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/machine-status.scm#n118>?
Thanks!
Ludo’.