Index: dbwars/sqlite3-test.scm ================================================================== --- dbwars/sqlite3-test.scm +++ dbwars/sqlite3-test.scm @@ -3,12 +3,17 @@ (include "test-common.scm") (define db (open-database "test.db")) (execute db test-table-defn) +(execute db syncsetup) (define (register-test db run-id testname host cpuload diskfree uname rundir shortdir item-path state status final-logf run-duration comment event-time) (execute db test-insert run-id testname host cpuload diskfree uname rundir shortdir item-path state status final-logf run-duration comment event-time)) + +(create-tests db) + +(finalize! db) Index: dbwars/test-common.scm ================================================================== --- dbwars/test-common.scm +++ dbwars/test-common.scm @@ -37,10 +37,11 @@ CONSTRAINT testsconstraint UNIQUE (run_id, testname, item_path) );") (define test-insert "INSERT INTO tests (run_id,testname,host,cpuload,diskfree,uname,rundir,shortdir,item_path,state,status,final_logf,run_duration,comment,event_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );") +(define syncsetup "PRAGMA synchronous = OFF;") (define tests '("test0" "test1" "test2" "test3" "test4" "test5" "test6" "test7" "test8" "test9")) (define items '()) (for-each (lambda (n) @@ -47,17 +48,17 @@ (for-each (lambda (m) (set! items (cons (conc "item/" n m) items))) '(0 1 2 3 4 5 6 7 8 9))) '(0 1 2 3 4 5 6 7 8 9)) -(define hosts '("host0" "host1" "host2" "host3" "host4" "host5" "host6" "host7" "host8" "host9")) -(define cpuloads '(0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)) -(define diskfrees '(100000 200000 300000 400000 500000 600000 700000 800000 900000)) +(define hosts '("host0" "host1" "host2")) ;; "host3" "host4" "host5" "host6" "host7" "host8" "host9")) +(define cpuloads '(0.1 0.2 0.3)) ;; 0.4 0.5 0.6 0.7 0.8 0.9)) +(define diskfrees '(100000 200000)) ;; 300000 400000 500000 600000 700000 800000 900000)) (define uname "Linux xena 3.5.0-40-generic #62~precise1-Ubuntu SMP Fri Aug 23 17:59:10 UTC 2013 i686 i686 i386 GNU/Linux") (define basedir "/mfs/matt/data/megatest/runs/testing") (define final-logf "finallog.html") -(define run-durations (list 120 240 260)) +(define run-durations (list 120 240)) ;; 260)) (define comments '("" "this is a good one eh?" "this one sucks eh?" "just eh, eh?")) (define run-ids (make-hash-table)) (define max-run-id 1000) @@ -71,49 +72,58 @@ (hash-table-set! run-ids factor new-id) (list new-id factor))))) (define (create-tests db) - (for-each - (lambda (test) - (for-each - (lambda (item) - (for-each - (lambda (host) - (for-each - (lambda (cpuload) - (for-each - (lambda (diskfree) - (for-each - (lambda (run-duration) - (for-each - (lambda (comment) - (let* ((run-id-dat (test-factors->run-id host cpuload diskfree run-duration comment)) - (run-id (car run-id-dat)) - (factor (cadr run-id-dat))) - (print "Adding " run-id " " test " " item " " factor) - (register-test db - run-id - test ;; testname - host - cpuload - diskfree - uname - (conc basedir "/" test "/" item) ;; rundir - (conc test "/" item) ;; shortdir - item ;; item-path - "NOT_STARTED" ;; state - "NA" ;; status - final-logf - run-duration - comment - (current-seconds)))) - comments)) - run-durations)) - diskfrees)) - cpuloads)) - hosts)) - items)) - tests)) + (let ((num-created 0) + (last-print (current-seconds)) + (start-time (current-seconds))) + (for-each + (lambda (test) + (for-each + (lambda (item) + (for-each + (lambda (host) + (for-each + (lambda (cpuload) + (for-each + (lambda (diskfree) + (for-each + (lambda (run-duration) + (for-each + (lambda (comment) + (let* ((run-id-dat (test-factors->run-id host cpuload diskfree run-duration comment)) + (run-id (car run-id-dat)) + (factor (cadr run-id-dat)) + (curr-time (current-seconds))) + (if (> (- curr-time last-print) 10) + (begin + (print "Adding " run-id " " test " " item " " factor " (added " num-created " records so far)") + (set! last-print curr-time))) + (set! num-created (+ num-created 1)) + (register-test db + run-id + test ;; testname + host + cpuload + diskfree + uname + (conc basedir "/" test "/" item) ;; rundir + (conc test "/" item) ;; shortdir + item ;; item-path + "NOT_STARTED" ;; state + "NA" ;; status + final-logf + run-duration + comment + (current-seconds)))) + comments)) + run-durations)) + diskfrees)) + cpuloads)) + hosts)) + items)) + tests) + (print "create-tests ran register-test " num-created " times in " (- (current-seconds) start-time) " seconds")))