691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
|
;; ;; (mutex-unlock! *db-multi-sync-mutex*)
;; ;; (stack-push! (dbr:dbstruct-dbstack dbstruct) tmpdb)))
;; NOTE: touched logic is disabled/not done
;; sync run to disk if touched
;;
(define (db:sync-inmem->disk dbstruct apath dbfile #!key (force-sync #f))
#f) ;; disabled
;; (let* ((dbdat (db:get-dbdat dbstruct apath dbfile))
;; (dbfullname (conc apath "/" dbfile))
;; (db (db:open-run-db dbfullname db:initialize-db)) ;; (dbr:dbdat-db dbdat))
;; (inmem (dbr:dbdat-inmem dbdat))
;; (start-t (current-seconds))
;; (last-update (dbr:dbdat-last-write dbdat))
;; (last-sync (dbr:dbdat-last-sync dbdat)))
|
>
>
|
|
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
;; ;; (mutex-unlock! *db-multi-sync-mutex*)
;; ;; (stack-push! (dbr:dbstruct-dbstack dbstruct) tmpdb)))
;; NOTE: touched logic is disabled/not done
;; sync run to disk if touched
;;
(define (db:sync-inmem->disk dbstruct apath dbfile #!key (force-sync #f))
(if #f
(debug:print-info 0 *default-log-port* "syncing "*toppath*" "dbfile" at "(current-seconds))
#f)) ;; disabled
;; (let* ((dbdat (db:get-dbdat dbstruct apath dbfile))
;; (dbfullname (conc apath "/" dbfile))
;; (db (db:open-run-db dbfullname db:initialize-db)) ;; (dbr:dbdat-db dbdat))
;; (inmem (dbr:dbdat-inmem dbdat))
;; (start-t (current-seconds))
;; (last-update (dbr:dbdat-last-write dbdat))
;; (last-sync (dbr:dbdat-last-sync dbdat)))
|
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
|
;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id NOT IN (SELECT id FROM runs WHERE state='deleted') AND NOT (uname = 'n/a' AND item_path = '');")
"SELECT count(id) FROM tests WHERE state in ('RUNNING','REMOTEHOSTSTART','LAUNCHED') AND run_id=?;"
run-id)))) ;; NOT IN (SELECT id FROM runs WHERE state='deleted');")
;; NEW BEHAVIOR: Look only at single run with run-id
;;
;; (define (db:get-running-stats dbstruct run-id)
(define (db:get-count-tests-running-for-run-id dbstruct run-id) ;; fastmode)
(let* ((qry ;; (if fastmode
;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? LIMIT 1;"
"SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=?;")) ;; )
(db:with-db
dbstruct
run-id
#f
(lambda (db)
(let* ((stmth (db:get-cache-stmth dbstruct db qry)))
(sqlite3:first-result stmth run-id))))))
|
|
<
<
|
|
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
|
;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id NOT IN (SELECT id FROM runs WHERE state='deleted') AND NOT (uname = 'n/a' AND item_path = '');")
"SELECT count(id) FROM tests WHERE state in ('RUNNING','REMOTEHOSTSTART','LAUNCHED') AND run_id=?;"
run-id)))) ;; NOT IN (SELECT id FROM runs WHERE state='deleted');")
;; NEW BEHAVIOR: Look only at single run with run-id
;;
;; (define (db:get-running-stats dbstruct run-id)
(define (db:get-count-tests-running-for-run-id dbstruct run-id)
(let* ((qry "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=?;")) ;; )
(db:with-db
dbstruct
run-id
#f
(lambda (db)
(let* ((stmth (db:get-cache-stmth dbstruct db qry)))
(sqlite3:first-result stmth run-id))))))
|