Megatest

Diff
Login

Differences From Artifact [3098ddb7dd]:

To Artifact [1dd9692520]:


1763
1764
1765
1766
1767
1768
1769










1770
1771
1772
1773
1774
1775
1776
1777

;; calculate a delay number based on a droop curve
;;    inputs are:
;;      - load-in, load as from uptime, NOT normalized
;;      - numcpus, number of cpus, ideally use the real cpus, not threads
;;
(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+)"))
;; 	 (cpu-load #f))







>
>
>
>
>
>
>
>
>
>
|







1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787

;; calculate a delay number based on a droop curve
;;    inputs are:
;;      - load-in, load as from uptime, NOT normalized
;;      - numcpus, number of cpus, ideally use the real cpus, not threads
;;
(define (common:get-delay load-in numcpus)
  (let* ((ratio (/ load-in numcpus))
         (new-option (configf:lookup *configdat* "load" "new-load-method")))
    (if new-option
      (begin
        (cond ((and (>= ratio 0) (<= ratio .9))
          (* ratio (/ 5 .9)))
        ((and (> ratio .9) (<= ratio 1.1))
          (+ 5 (* (- ratio .9) (/ 55 .2)))) 
        ((> ratio 1.1)
          60)))
      (max (/ (expt 5 (* 4 ratio)) 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+)"))
;; 	 (cpu-load #f))