@@ -720,18 +720,35 @@ ;; DOES cdb:remote-run under the hood! (let* ((cpuload (get-cpu-load)) (diskfree (get-df (current-directory)))) (tests:update-testdat-meta-info db test-id work-area cpuload diskfree minutes) ;; Update central with uname and hostname = #f - (tests:update-central-meta-info test-id cpuload diskfree minutes #f #f))) + ;; Is this one of the performance problems? This info should come from testdat-meta anyway + ;; (tests:update-central-meta-info test-id cpuload diskfree minutes #f #f) + )) (define (tests:update-testdat-meta-info db test-id work-area cpuload diskfree minutes) (let ((tdb (db:open-test-db-by-test-id db test-id work-area: work-area))) - (sqlite3:execute tdb "INSERT INTO test_rundat (update_time,cpuload,diskfree,run_duration) VALUES (strftime('%s','now'),?,?,?);" - cpuload diskfree minutes) - (sqlite3:finalize! tdb))) - + (if tdb + (begin + (sqlite3:execute tdb "INSERT INTO test_rundat (update_time,cpuload,diskfree,run_duration) VALUES (strftime('%s','now'),?,?,?);" + cpuload diskfree minutes) + (sqlite3:finalize! tdb)) + (debug:print 2 "Can't update testdat.db for test " test-id " read-only or non-existant")))) + +(define (tests:testdat-get-testinfo db test-id work-area) + (let ((tdb (db:open-test-db-by-test-id db test-id work-area: work-area)) + (res '())) + (if tdb + (sqlite3:for-each-row + (lambda (update-time cpuload diskfree run-duration) + (set! res (cons (vector update-time cpuload diskfree run-duration) res))) + tdb + "SELECT update_time,cpuload,diskfree,run_duration FROM test_rundat ORDER BY update_time ASC;") + (sqlite3:finalize! tdb)) + res)) + ;;====================================================================== ;; A R C H I V I N G ;;====================================================================== (define (test:archive db test-id)