Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -1704,10 +1704,21 @@ path) ;; just give up (with-input-from-pipe (conc "/bin/readlink -f " path) (lambda () (read-line))))) + +(define (common:get-intercept onemin fivemin) + (let* ((load-change (- onemin fivemin)) + (tchange (- 300 60))) + (max (+ onemin (* 60 (/ load-change tchange)))0)) +) + +(define (common:get-delay load-in numcpus) + (max (/ (expt 5 (* 4 (/ load-in numcpus))) 10) 0) +) + (define (get-cpu-load #!key (remote-host #f)) (car (common:get-cpu-load remote-host))) ;; (let* ((load-res (process:cmd-run->list "uptime")) ;; (load-rx (regexp "load average:\\s+(\\d+)"))