[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/11: offload: 'status' reports the time difference.
From: |
guix-commits |
Subject: |
06/11: offload: 'status' reports the time difference. |
Date: |
Tue, 22 Jan 2019 17:05:11 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 02ec889e6b8f6593dd90afcb4d60a43ea67be4b8
Author: Ludovic Courtès <address@hidden>
Date: Tue Jan 22 17:37:59 2019 +0100
offload: 'status' reports the time difference.
* guix/scripts/offload.scm (check-machine-status): Report the time
difference for each MACHINE.
---
guix/scripts/offload.scm | 37 +++++++++++++++++++++++++------------
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 2116b38..eb02672 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -712,18 +712,31 @@ machine."
(warning (G_ "failed to run 'guix repl' on machine '~a'~%")
(build-machine-name machine)))
((? inferior? inferior)
- (let ((uts (inferior-eval '(uname) inferior))
- (load (node-load inferior))
- (free (node-free-disk-space inferior)))
- (close-inferior inferior)
- (format #t "~a~% kernel: ~a ~a~% architecture: ~a~%\
- host name: ~a~% normalized load: ~a~% free disk space: ~,2f MiB~%"
- (build-machine-name machine)
- (utsname:sysname uts) (utsname:release uts)
- (utsname:machine uts)
- (utsname:nodename uts)
- (normalized-load machine load)
- (/ free (expt 2 20) 1.)))))
+ (let ((now (car (gettimeofday))))
+ (match (inferior-eval '(list (uname)
+ (car (gettimeofday)))
+ inferior)
+ ((uts time)
+ (when (< time now)
+ ;; Build machine clocks must not be behind as this
+ ;; could cause timestamp issues.
+ (warning (G_ "machine '~a' is ~a seconds behind~%")
+ (build-machine-name machine)
+ (- now time)))
+
+ (let ((load (node-load inferior))
+ (free (node-free-disk-space inferior)))
+ (close-inferior inferior)
+ (format #t "~a~% kernel: ~a ~a~% architecture:
~a~%\
+ host name: ~a~% normalized load: ~a~% free disk space: ~,2f MiB~%\
+ time difference: ~a s~%"
+ (build-machine-name machine)
+ (utsname:sysname uts) (utsname:release uts)
+ (utsname:machine uts)
+ (utsname:nodename uts)
+ (normalized-load machine load)
+ (/ free (expt 2 20) 1.)
+ (- time now))))))))
(disconnect! session))
machines)))
- branch master updated (d1dfcc7 -> ce6236f), guix-commits, 2019/01/22
- 02/11: self: Remove leftover export., guix-commits, 2019/01/22
- 04/11: compile: Let compiler warnings through during the load phase., guix-commits, 2019/01/22
- 03/11: gnu: Remove duplicate record fields., guix-commits, 2019/01/22
- 01/11: vm: Remove unnecessary import., guix-commits, 2019/01/22
- 05/11: records: Detect duplicate field initializers., guix-commits, 2019/01/22
- 07/11: self: System tests depend on CLI modules., guix-commits, 2019/01/22
- 06/11: offload: 'status' reports the time difference.,
guix-commits <=
- 11/11: doc: Move "Package Modules" under "Programming Interface"., guix-commits, 2019/01/22
- 08/11: doc: Move sections under "GNU Distribution" one level higher., guix-commits, 2019/01/22
- 10/11: doc: Move "Packaging Guidelines" under "Contributing"., guix-commits, 2019/01/22
- 09/11: doc: Move "System Installation" right after "Installation"., guix-commits, 2019/01/22