Changes In Branch sqlite3-logging Through [7ee796c14e] Excluding Merge-Ins
This is equivalent to a diff from 521a37d7f3 to 7ee796c14e
2012-10-11
| ||
00:11 | Merged trunk into logging check-in: 7d49a78e24 user: matt tags: sqlite3-logging | |
2012-10-09
| ||
15:58 | Partial fix for simultaneously preventing races on launch of new jobs and respecting use of max-concurrent-jobs check-in: f1b027a2e2 user: matt tags: trunk | |
12:00 | Merged in needed change to Makefile for logging check-in: 7ee796c14e user: matt tags: sqlite3-logging | |
09:45 | Added better signature to makefile target but not enabled yet check-in: 521a37d7f3 user: matt tags: trunk | |
09:30 | Merged sqlite3 db logging to new branch check-in: 69f6bf8f5a user: matt tags: sqlite3-logging | |
2012-10-08
| ||
23:49 | Added kill of dboard to kill target check-in: e1d9cf7044 user: matt tags: trunk, test1-test4-clean-with-rpc-ubuntu, v1.4612 | |
Modified common.scm from [b1035eae27] to [cc91d853d4].
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | - + + + + + | (define *configdat* #f) (define *toppath* #f) (define *already-seen-runconfig-info* #f) (define *waiting-queue* (make-hash-table)) (define *test-meta-updated* (make-hash-table)) (define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define *passnum* 0) ;; when running track calls to run-tests or similar |
︙ |
Modified common_records.scm from [305c308b19] to [d3914aa282].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | + - - + + + + | ;;====================================================================== ;; 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. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== (define-inline (debug:print n . params) (begin |
Modified db.scm from [606081fd7b] to [378f0551a1].
︙ | |||
216 217 218 219 220 221 222 223 224 225 226 227 228 229 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | + + + + | status TEXT DEFAULT 'n/a', type TEXT DEFAULT '', CONSTRAINT test_data_constraint UNIQUE (test_id,category,variable));") ;; Must do this *after* running patch db !! No more. (db:set-var db "MEGATEST_VERSION" megatest-version) )) ;;====================================================================== ;; T E S T S P E C I F I C D B ;;====================================================================== ;; Create the sqlite db for the individual test(s) (define (open-test-db testpath) (if (and (directory? testpath) (file-read-access? testpath)) (let* ((dbpath (conc testpath "/testdat.db")) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) |
︙ | |||
285 286 287 288 289 290 291 292 293 294 295 296 297 298 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | + + + + + + + + + + + + + + + + + + + + + + + + + | ;; the ackstate is set to 1 once the command has been completed "CREATE TABLE IF NOT EXISTS test_meta ( id INTEGER PRIMARY KEY, var TEXT, val TEXT, ackstate INTEGER DEFAULT 0, CONSTRAINT metadat_constraint UNIQUE (var));"))) ;;====================================================================== ;; L O G G I N G D B ;;====================================================================== (define (open-logging-db) ;; (conc *toppath* "/megatest.db") (car *configinfo*))) (let* ((dbpath (conc (if *toppath* (conc *toppath* "/") "") "logging.db")) ;; fname) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) (handler (make-busy-timeout (if (args:get-arg "-override-timeout") (string->number (args:get-arg "-override-timeout")) 36000)))) ;; 136000))) (sqlite3:set-busy-handler! db handler) (if (not dbexists) (begin (sqlite3:execute db "CREATE TABLE IF NOT EXISTS log (id INTEGER PRIMARY KEY,event_time TIMESTAMP DEFAULT (strftime('%s','now')),logline TEXT);") (sqlite3:execute db (conc "PRAGMA synchronous = 0;")))) db)) (define (db:log-event . loglst) (let ((db (open-logging-db)) (logline (apply conc loglst))) (sqlite3:execute db "INSERT INTO log (logline) VALUES (?);" logline) (sqlite3:finalize! db) logline)) ;;====================================================================== ;; TODO: ;; put deltas into an assoc list with version numbers ;; apply all from last to current ;;====================================================================== (define (patch-db db) |
︙ |
Modified megatest.scm from [e8b477af90] to [a442c44f02].
︙ | |||
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | + + | -update-meta : update the tests metadata for all tests -env2file fname : write the environment to fname.csh and fname.sh -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these are overwritten by values set in config files. -server -|hostname : start the server (reduces contention on megatest.db), use - to automatically figure out hostname -repl : start a repl (useful for extending megatest) -debug N : increase verbosity to N. (try 10 for lots of noise) -logging : turn on logging all debug output to logging.db Spreadsheet generation -extract-ods fname.ods : extract an open document spreadsheet from the database -pathmod path : insert path, i.e. path/runame/itempath/logfile.html will clear the field if no rundir/testname/itempath/logfile if it contains forward slashes the path will be converted to windows style |
︙ | |||
188 189 190 191 192 193 194 195 196 197 198 199 200 201 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | + | "-rebuild-db" "-rollup" "-update-meta" "-gen-megatest-area" "-v" ;; verbose 2, more than normal (normal is 1) "-q" ;; quiet 0, errors/warnings only "-logging" ) args:arg-hash 0)) (if (args:get-arg "-h") (begin (print help) |
︙ | |||
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | + + | ((args:get-arg "-q") 0) (else 1))) (if (not (number? *verbosity*)) (begin (print "ERROR: Invalid debug value " (args:get-arg "-debug")) (exit))) (if (args:get-arg "-logging")(set! *logging* #t)) ;;====================================================================== ;; Misc general calls ;;====================================================================== (if (args:get-arg "-env2file") (begin |
︙ |
Modified server.scm from [5d7f3edf83] to [d8295b1488].
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + | (hostname (if (string=? "-" hostn) (get-host-name) hostn)) (ipaddrstr (if (string=? "-" hostn) (string-intersperse (map number->string (u8vector->list (hostname->ip hostname))) ".") #f)) (host:port (conc (if ipaddrstr ipaddrstr hostname) ":" (rpc:default-server-port)))) (debug:print 0 "Server started on " host:port) (db:set-var db "SERVER" host:port) (set! *cache-on* #t) ;; can use this to run most anything at the remote (rpc:publish-procedure! 'remote:run (lambda (procstr . params) |
︙ | |||
134 135 136 137 138 139 140 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | - + | (mutex-unlock! *incoming-mutex*) (if (> queue-len 0) (begin (debug:print 0 "INFO: Queue not flushed, waiting ...") (loop (+ n 1))))) ))) (thread-start! th1) |
︙ | |||
169 170 171 172 173 174 175 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - - + + | (define (server:find-free-port-and-open port) (handle-exceptions exn (begin (print "Failed to bind to port " (rpc:default-server-port) ", trying next port") (server:find-free-port-and-open (+ port 1))) (rpc:default-server-port port) |
︙ |