Megatest

Check-in [71f876d389]
Login
Overview
Comment:Fixed MTLOWEST load
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.80
Files: files | file ages | folders
SHA1: 71f876d38909ed1f5130e0f216dc46a37af64756
User & Date: matt on 2023-04-06 08:01:35
Other Links: branch diff | manifest | tags
Context
2023-04-06
09:23
Fixed performance issue with append in runs.scm check-in: 0dc6c83d6e user: matt tags: v1.80
08:01
Fixed MTLOWEST load check-in: 71f876d389 user: matt tags: v1.80
06:35
Turn on portlogger check-in: 5cf2865c15 user: matt tags: v1.80
Changes

Modified common.scm from [106d62a823] to [758312d94b].

1809
1810
1811
1812
1813
1814
1815






1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
    (cond
     ((and (list? res)
	   (> (length res) 2))
      res)
     ((eq? res #f)   default) ;; add messages?
     ((eq? res #f) default)   ;; this would be the #eof
     (else default))))







(define (common:get-normalized-cpu-load-raw remote-host)
  (let* ((actual-host (or remote-host (get-host-name)))) ;; #f is localhost
    (or (common:get-cached-info actual-host "normalized-load")
	(let ((data (if remote-host
			(let ((inp #f))
			  (handle-exceptions
			      exn
			    (begin
			      (close-input-port inp)
			      '())
			    (set! inp (open-input-port (conc "ssh " remote-host " \"cat /proc/loadavg;cat /proc/cpuinfo;echo end\"")))
			    (let* ((res (read-lines inp)))
			      (close-input-port inp)
			      res)))
			(append 
			 (with-input-from-file "/proc/loadavg" 
			   read-lines)
			 (with-input-from-file "/proc/cpuinfo"
			   read-lines)
			 (list "end"))))
	      (load-rx  (regexp "^([\\d\\.]+)\\s+([\\d\\.]+)\\s+([\\d\\.]+)\\s+.*$"))







>
>
>
>
>
>





<
<
<
<
<
<
|
<
<
<







1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826






1827



1828
1829
1830
1831
1832
1833
1834
    (cond
     ((and (list? res)
	   (> (length res) 2))
      res)
     ((eq? res #f)   default) ;; add messages?
     ((eq? res #f) default)   ;; this would be the #eof
     (else default))))

(define (common:ssh-get-loadavg remote-host)
  (let ((inp (open-input-pipe (conc "ssh " remote-host " \"cat /proc/loadavg;cat /proc/cpuinfo;echo end\""))))
      (let* ((res (read-lines inp)))
	(close-input-pipe inp)
	res)))

(define (common:get-normalized-cpu-load-raw remote-host)
  (let* ((actual-host (or remote-host (get-host-name)))) ;; #f is localhost
    (or (common:get-cached-info actual-host "normalized-load")
	(let ((data (if remote-host






			(common:ssh-get-loadavg remote-host)



			(append 
			 (with-input-from-file "/proc/loadavg" 
			   read-lines)
			 (with-input-from-file "/proc/cpuinfo"
			   read-lines)
			 (list "end"))))
	      (load-rx  (regexp "^([\\d\\.]+)\\s+([\\d\\.]+)\\s+([\\d\\.]+)\\s+.*$"))