Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -42,10 +42,11 @@ (define *rpc:listener* #f) ;; if set up for server communication this will hold the tcp port (define *runremote* #f) ;; if set up for server communication this will hold (define *last-db-access* 0) ;; update when db is accessed via server (define *target* #f) ;; cache the target here; target is keyval1/keyval2/.../keyvalN (define *toptest-paths* (make-hash-table)) ;; cache toptest path settings here +(define *run-info-cache* (make-hash-table)) ;; run info is stable, no need to reget (define (get-with-default val default) (let ((val (args:get-arg val))) (if val val default))) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -345,26 +345,30 @@ "SELECT COUNT(id) FROM runs WHERE runname LIKE ?;" runpatt) numruns)) ;; use (get-value-by-header (db:get-header runinfo)(db:get-row runinfo)) (define (db:get-run-info db run-id) - (let* ((res #f) - (keys (db:get-keys db)) - (remfields (list "id" "runname" "state" "status" "owner" "event_time")) - (header (append (map key:get-fieldname keys) - remfields)) - (keystr (conc (keys->keystr keys) "," - (string-intersperse remfields ",")))) - ;; (debug:print 0 "db:get-run-info run-id: " run-id " header: " header " keystr: " keystr) - (sqlite3:for-each-row - (lambda (a . x) - (set! res (apply vector a x))) - db - (conc "SELECT " keystr " FROM runs WHERE id=?;") - run-id) - (vector header res))) - + (if (hash-table-ref/default *run-info-cache* run-id #f) + (hash-table-ref *run-info-cache* run-id) + (let* ((res #f) + (keys (db:get-keys db)) + (remfields (list "id" "runname" "state" "status" "owner" "event_time")) + (header (append (map key:get-fieldname keys) + remfields)) + (keystr (conc (keys->keystr keys) "," + (string-intersperse remfields ",")))) + ;; (debug:print 0 "db:get-run-info run-id: " run-id " header: " header " keystr: " keystr) + (sqlite3:for-each-row + (lambda (a . x) + (set! res (apply vector a x))) + db + (conc "SELECT " keystr " FROM runs WHERE id=?;") + run-id) + (let ((finalres (vector header res))) + (hash-table-set! *run-info-cache* run-id finalres) + finalres)))) + (define (db:set-comment-for-run db run-id comment) (sqlite3:execute db "UPDATE runs SET comment=? WHERE id=?;" comment run-id)) ;; does not (obviously!) removed dependent data. (define (db:delete-run db run-id) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -1,6 +1,6 @@ -\ + ;; Copyright 2006-2012, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -22,16 +22,16 @@ cleanprep : ../*.scm sqlite3 megatest.db "delete from metadat where var='SERVER';" mkdir -p /tmp/mt_runs /tmp/mt_links cd ..;make @sleep 1 - @if ps -def |awk '{print $8}'|grep megatest; then \ - echo WARNING: These tests will kill megatest and dashboard!; \ - sleep 3; \ - killall -9 dboard || true; \ - killall -9 megatest || true; \ - fi + # @if ps -def |awk '{print $8}'|grep megatest; then \ + # echo WARNING: These tests will kill megatest and dashboard!; \ + # sleep 3; \ + # killall -9 dboard || true; \ + # killall -9 megatest || true; \ + # fi cd ../;make install $(MEGATEST) -remove-runs :runname $(RUNNAME)% -target %/%/% -testpatt % -itempatt % $(BINPATH)/dboard -rows 15 & touch cleanprep