190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
-
+
|
;;
(define (dbfile:run-id->path apath run-id)
(conc apath"/"(dbfile:run-id->dbname run-id)))
(define (db:dbname->path apath dbname)
(conc apath"/"dbname))
(define num-run-dbs (make-parameter 2))
(define num-run-dbs (make-parameter 4))
(define (dbfile:run-id->dbnum run-id)
(cond
((number? run-id)
(modulo run-id (num-run-dbs)))
((not run-id) "main") ;; 0 or main?
(else run-id)))
|
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
|
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
|
-
+
+
+
+
+
+
+
+
|
(set! *db-write-access* (not (dbr:dbdat-read-only dbdat)))
;; (mutex-unlock! *db-open-mutex*)
dbdat))
(define dbfile:db-init-proc (make-parameter #f))
(define keep-age-param (make-parameter 10))
(define qif-slope (make-parameter 100))
;; in xmaxima this gives a curve close to what I want:
;; plot2d ((exp(x/1.2)-1)/300, [x, 0, 10])$
;; plot2d ((exp(x/1.5)-1)/40, [x, 0, 10])$
;; plot2d ((exp(x/5)-1)/40, [x, 0, 20])$
(define (dbfile:droop x)
(/ (- (exp (/ x 5)) 1) 40))
;; (* numqrys (/ 1 (qif-slope))))
;; create a dropping near the db file in a qif dir
;; use count of such files to gate queries (queries in flight)
;;
(define (dbfile:wait-for-qif fname run-id params)
(let* ((thedir (pathname-directory fname))
(dbnum (dbfile:run-id->dbnum run-id))
|
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
|
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
|
-
+
|
;; (delete-file* f)
(handle-exceptions
exn
#t
(file-move f destf #t)))))
currlks))
1) ;; 50 and above => 1
((> numqrys 10) (* numqrys (/ 1 (qif-slope)))) ;; slope of 1/100
((> numqrys 10) (dbfile:droop numqrys)) ;; slope of 1/100
;; ((> numqrys 30) 0.50)
;; ((> numqrys 25) 0.20)
;; ((> numqrys 20) 0.10)
;; ((> numqrys 15) 0.05)
;; ((> numqrys 10) 0.01)
(else #f))))
(if (and delayval
|