Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -80,16 +80,18 @@ (define *last-global-delta-printed* 0) (define (open-run-close-measure proc idb . params) (let* ((start-ms (current-milliseconds)) (db (if idb idb (open-db))) (throttle (string->number (config-lookup *configdat* "setup" "throttle")))) - (if (equal? (config-lookup *configdat* "setup" "synchronous") "yes") - (sqlite3:execute db "PRAGMA synchronous = 0;")) + + (db:set-sync db) (set! res (apply proc db params)) (if (not idb)(sqlite3:finalize! db)) ;; scale by 10, average with current value. - (set! *global-delta* (/ (+ *global-delta* (/ (- (current-milliseconds) start-ms) (if throttle throttle 100))) 2)) + (set! *global-delta* (/ (+ *global-delta* (* (- (current-milliseconds) start-ms) + (if throttle throttle 0.01))) + 2)) (if (> (abs (- *last-global-delta-printed* *global-delta*)) 0.08) ;; don't print all the time, only if it changes a bit (begin (debug:print 1 "INFO: launch throttle factor=" *global-delta*) (set! *last-global-delta-printed* *global-delta*))) res)) @@ -797,11 +799,11 @@ test-id) (if res (db:patch-tdb-data-into-test-info db test-id res)) res))))) ;; Get test data using test_id -(define (db:get-test-info-by-id db test-id) +(define (db:get-test-info-not-cached-by-id db test-id) (if (not test-id) (begin (debug:print 4 "INFO: db:get-test-info-by-id called with test-id=" test-id) #f) (let ((res #f)) @@ -811,10 +813,12 @@ (set! res (vector id run-id testname state status event-time host cpuload diskfree uname rundir item-path run_duration final_logf comment))) db "SELECT id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment FROM tests WHERE id=?;" test-id) res))) + +(define db:get-test-info-by-id db:get-test-info-cached-by-id) (define (db:get-test-info db run-id testname item-path) (db:get-test-info-by-id db (db:get-test-id db run-id testname item-path))) (define (db:test-set-comment db test-id comment) Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -11,11 +11,12 @@ [include config/mt_include_1.config] [setup] # FULL or 2, NORMAL or 1, OFF or 0 synchronous OFF -throttle 50 +# Throttle roughly scales the db access milliseconds to seconds delay +throttle 0.02 [validvalues] state start end status pass fail n/a 0 1 running