Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -1472,11 +1472,11 @@ ;; get normalized cpu load by reading from /proc/loadavg and /proc/cpuinfo return all three values and the number of real cpus and the number of threads ;; returns alist '((adj-cpu-load . normalized-proc-load) ... etc. ;; keys: adj-proc-load, adj-core-load, 1m-load, 5m-load, 15m-load ;; (define (common:get-normalized-cpu-load remote-host) - (or (common:get-cached-info remote-host "normalized-load") + (or (and remote-host (common:get-cached-info remote-host "normalized-load")) (let ((data (if remote-host (with-input-from-pipe (conc "ssh " remote-host " cat /proc/loadavg;cat /proc/cpuinfo;echo end") read-lines) (append @@ -1512,12 +1512,13 @@ (list (cons '1m-load (car loads)) (cons '5m-load (cadr loads)) (cons '15m-load (caddr loads))) (list (cons 'proc act-proc) (cons 'core act-core) - (cons 'phys act-phys))))) - (common:write-cached-info remote-host "normalized-load" result) + (cons 'phys act-phys)))) + (the-host (or remote-host (current-host-name)))) + (common:write-cached-info the-host "normalized-load" result) result) (regex-case hed (load-rx ( x l1 l5 l15 ) (loop (car tal)(cdr tal)(map string->number (list l1 l5 l15)) proc-num phys-num core-num)) (proc-rx ( x p ) (loop (car tal)(cdr tal) loads (max-num p proc-num) phys-num core-num))