Overview
Comment: | Merged in fix for -list-runs not respecting -target, minor edits to dbstruct handling |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | inmem-per-run-db |
Files: | files | file ages | folders |
SHA1: |
f2108ba85f2d1a9fa4567c59869a2e59 |
User & Date: | matt on 2013-11-25 23:02:59 |
Other Links: | branch diff | manifest | tags |
Context
2013-11-25
| ||
23:58 | Getting there check-in: b47fdd6750 user: matt tags: inmem-per-run-db | |
23:02 | Merged in fix for -list-runs not respecting -target, minor edits to dbstruct handling check-in: f2108ba85f user: matt tags: inmem-per-run-db | |
13:59 | Fixed -list-runs to work with -target filter check-in: 21925e0dcb user: mrwellan tags: v1.55, v1.5514 | |
2013-11-24
| ||
23:51 | More progress/porting check-in: 3a6d63e86a user: matt tags: inmem-per-run-db | |
Changes
Modified db.scm from [b6656cda10] to [8131c38c5f].
︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + + + + + + | (define (db:done-with dbstruct run-id mod-read) (mutex-lock! *rundb-mutex*) (if (eq? mod-read 'mod) (dbr:dbstruct-set-runvec! dbstruct run-id 'mtime (current-milliseconds)) (dbr:dbstruct-set-runvec! dbstruct run-id 'rtime (current-milliseconds))) (dbr:dbstruct-set-runvec! dbstruct run-id 'inuse #f) (mutex-unlock! *rundb-mutex*)) ;; (db:with-db dbstruct run-id sqlite3:exec "select blah from blaz;") ;; r/w is a flag to indicate if the db is modified by this query #t = yes, #f = no ;; (define (db:with-db dbstruct run-id r/w proc . params) (let* ((db (db:get-db dbstruct run-id))) (let ((res (apply proc db params))) (db:done-with dbstruct run-id r/w) res))) ;;====================================================================== ;; K E E P F I L E D B I N dbstruct ;;====================================================================== (define (db:get-filedb dbstruct) (let ((db (vector-ref dbstruct 2))) |
︙ | |||
167 168 169 170 171 172 173 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | + - + + | ;; close all opened run-id dbs (define (db:close-all dbstruct) ;; finalize main.db (sqlite3:finalize! (db:get-db dbstruct #f)) (for-each (lambda (runvec) (let ((rundb (vector-ref runvec (dbr:dbstruct-field-name->num 'rundb)))) (if (sqlite3:database? rundb) |
︙ | |||
418 419 420 421 422 423 424 | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | - - - - - - - - - - - + + + + + + + + + + + + - + - + | (exit 1))))) keys) (sqlite3:execute db "CREATE TABLE IF NOT EXISTS keys (id INTEGER PRIMARY KEY, fieldname TEXT, fieldtype TEXT, CONSTRAINT keyconstraint UNIQUE (fieldname));") (for-each (lambda (key) (sqlite3:execute db "INSERT INTO keys (fieldname,fieldtype) VALUES (?,?);" key "TEXT")) keys) (sqlite3:execute db (conc |
︙ | |||
713 714 715 716 717 718 719 | 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | + + - - - - - + + + + + | ;; why get the keys from the db? why not get from the *configdat* ;; using keys:config-get-fields? (define (db:get-keys dbstruct) (if *db-keys* *db-keys* (let ((res '())) (db:with-db dbstruct #f #f (lambda (db) |
︙ | |||
959 960 961 962 963 964 965 | 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | + + - - - - - - + + + + + + | (exit 6))))) keyvals) (set! qry-str (conc "SELECT " keystr " FROM runs WHERE state != 'deleted' AND runname " runwildtype " ? " key-patt " ORDER BY event_time " (if limit (conc " LIMIT " limit) "") (if offset (conc " OFFSET " offset) "") ";")) (debug:print-info 4 "runs:get-runs-by-patt qry=" qry-str " " runnamepatt) (db:with-db dbstruct #f #f ;; reads db, does not write to it. (lambda (db) |
︙ | |||
1088 1089 1090 1091 1092 1093 1094 | 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 | - + | ;; T E S T S ;;====================================================================== ;; states and statuses are lists, turn them into ("PASS","FAIL"...) and use NOT IN ;; i.e. these lists define what to NOT show. ;; states and statuses are required to be lists, empty is ok ;; not-in #t = above behaviour, #f = must match |
︙ |
Modified db_records.scm from [312e31a234] to [315cdf30c2].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + - + | #f ;; the main db (contains runs, test_meta etc.) NOT CACHED IN MEM (make-hash-table) ;; run-id => [ rundb inmemdb last-mod last-read last-sync ] #f ;; the global string db (use for state, status etc.) path ;; path to database files/megatest area local)) ;; read-only local access ;; get and set main db |
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + | (let ((runvec (dbr:dbstruct-get-rundb-rec vec run-id)) (fieldnum (dbr:dbstruct-field-name->num field-name))) ;; (vector-set! runvec (dbr:dbstruct-field-name->num 'inuse) #t) (vector-ref runvec fieldnum))) (define (dbr:dbstruct-set-runvec! vec run-id field-name val) (let ((runvec (dbr:dbstruct-get-rundb-rec vec run-id))) |
︙ |
Modified megatest.scm from [38bd73f0db] to [1e184de173].
︙ | |||
352 353 354 355 356 357 358 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | - + + | ;; ;; Setup client for all expect listed here (if (null? (lset-intersection equal? (hash-table-keys args:arg-hash) '("-list-servers" "-stop-server" |
︙ | |||
564 565 566 567 568 569 570 | 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | + - + + + + - | (args:get-arg "-list-db-targets")) (if (setup-for-run) (let* ((dbstruct (make-dbr:dbstruct path: *toppath* local: #t)) (runpatt (args:get-arg "-list-runs")) (testpatt (if (args:get-arg "-testpatt") (args:get-arg "-testpatt") "%")) (keys (db:get-keys dbstruct)) |
︙ |