Megatest

Changes On Branch 7e2a9a176bbdeea6
Login

Changes In Branch testdata Through [7e2a9a176b] Excluding Merge-Ins

This is equivalent to a diff from 0e00d7e0c2 to 7e2a9a176b

2012-02-29
17:56
minor improvements to server mode check-in: 29dd546414 user: mrwellan tags: trunk
2012-02-28
21:28
Incrementail changes towards the test-info data split check-in: 0bdbd9ba53 user: matt tags: testdata
07:02
test_info initalization check-in: 7e2a9a176b user: matt tags: testdata
03:15
Initial steps to separate test data into file testdata.db check-in: 0187531d3d user: matt tags: testdata
2012-02-27
09:52
Partial fix for -rerun check-in: 0e00d7e0c2 user: matt tags: trunk
06:16
Upping version to v1.38 check-in: 275de76b6d user: matt tags: trunk, v1.38

Modified db.scm from [f1afc66bda] to [4bdf99dc8b].

34
35
36
37
38
39
40

41

42
43
44
45
46






47
48












49
50
51
52
53
54
55
(define *incoming-data*      '())
(define *incoming-last-time* (current-seconds))
(define *incoming-mutex*     (make-mutex))
(define *cache-on* #f)

(define (open-db) ;;  (conc *toppath* "/megatest.db") (car *configinfo*)))
  (let* ((dbpath    (conc *toppath* "/megatest.db")) ;; fname)

	 (dbexists  (file-exists? dbpath))

	 (db        (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath))
	 (handler   (make-busy-timeout 36000)))
    (sqlite3:set-busy-handler! db handler)
    (if (not dbexists)
	(db:initialize db))






    db))













(define (db:initialize db)
  (let* ((configdat (car *configinfo*))  ;; tut tut, global warning...
	 (keys     (config-get-fields configdat))
	 (havekeys (> (length keys) 0))
	 (keystr   (keys->keystr keys))
	 (fieldstr (keys->key/field keys)))
    (for-each (lambda (key)







>
|
>





>
>
>
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>







34
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
68
69
70
71
72
73
74
75
(define *incoming-data*      '())
(define *incoming-last-time* (current-seconds))
(define *incoming-mutex*     (make-mutex))
(define *cache-on* #f)

(define (open-db) ;;  (conc *toppath* "/megatest.db") (car *configinfo*)))
  (let* ((dbpath    (conc *toppath* "/megatest.db")) ;; fname)
         (tdatpath  (conc *toppath* "/testdata.db")))
	 (dbexists  (file-exists? dbpath)
         (tdatexists (file-exists? tdatpath))
	 (db        (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath))
	 (handler   (make-busy-timeout 36000)))
    (sqlite3:set-busy-handler! db handler)
    (if (not dbexists)
	(db:initialize db))
     (cond
	((and (not tdataexists)(not dbexists))
	 (db:initialize-test-data-db))
	((not tdataexists)
	 (db:migrate-to-testdata db)))
    (db:attach-testdata db)
     db))

;; Initialize the testdata db
(define (db:initialize-test-data-db)
  (let ((tdb (sqlite3:open-database (conc *toppath* "/testdata.db"))))
     (sqlite3:execute tdb "CREATE TABLE test_info (
        id INTEGER PRIMARY KEY,
    	diskspace INTEGER,
	cpuusage INTEGER,
	tmpdiskspace INTEGER,
	memoryusage INTEGER);")
      (sqlite3:finalize! tdb)))

;; Initialize the main db
(define (db:initialize db)
  (let* ((configdat (car *configinfo*))  ;; tut tut, global warning...
	 (keys     (config-get-fields configdat))
	 (havekeys (> (length keys) 0))
	 (keystr   (keys->keystr keys))
	 (fieldstr (keys->key/field keys)))
    (for-each (lambda (key)