102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
(tt:start-stats dbdir)) ;; fixme - find the right call to get the db directory
;; check the load on dbfname and add some delay using a droop curve of sorts
(if *journal-stats*
(let* ((load (tt:get-journal-stats dbfname)))
(if (> load 0.1) ;; start activating delay at 10% journal load time
(let ((dely (* 50 (* load load)))) ;; 100% journal time=50sec delay
(debug:print 0 *default-log-port* "Journal load "load" delaying queries "dely"s.")
(thread-sleep! dely)))))
(case (rmt:transport-mode)
((tcp)
(let* ((start-time (current-seconds)) ;; snapshot time so all use cases get same value
(attemptnum (+ 1 attemptnum))
(mtexe (common:find-local-megatest))
|
|
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
(tt:start-stats dbdir)) ;; fixme - find the right call to get the db directory
;; check the load on dbfname and add some delay using a droop curve of sorts
(if *journal-stats*
(let* ((load (tt:get-journal-stats dbfname)))
(if (> load 0.1) ;; start activating delay at 10% journal load time
(let ((dely (* 50 (* load load)))) ;; 100% journal time=50sec delay
(debug:print 0 *default-log-port* "Journal load "load" on "dbfname" delaying queries "dely"s.")
(thread-sleep! dely)))))
(case (rmt:transport-mode)
((tcp)
(let* ((start-time (current-seconds)) ;; snapshot time so all use cases get same value
(attemptnum (+ 1 attemptnum))
(mtexe (common:find-local-megatest))
|