Megatest

Check-in [e70a021208]
Login
Overview
Comment:Added control of throttle value to megatest.config
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | test-specific-db
Files: files | file ages | folders
SHA1: e70a021208170e2282e7a3072354c13e1fb9f85d
User & Date: mrwellan on 2012-09-23 16:27:08
Other Links: branch diff | manifest | tags
Context
2012-09-24
00:02
Added comment on mode check-in: eb47e2c93d user: matt tags: test-specific-db
2012-09-23
16:27
Added control of throttle value to megatest.config check-in: e70a021208 user: mrwellan tags: test-specific-db
12:48
Added back full ability to run synchronous=OFF check-in: a90c28df57 user: matt tags: test-specific-db
Changes

Modified db.scm from [c1b2f2e6f1] to [e1e46b9c2d].

63
64
65
66
67
68
69
70


71
72
73
74
75
76

77
78
79
80
81
82
83
63
64
65
66
67
68
69

70
71
72
73
74
75
76

77
78
79
80
81
82
83
84







-
+
+





-
+







    (if (not idb)(sqlite3:finalize! db))
    res))

(define *global-delta* 0)
(define *last-global-delta-printed* 0)
(define (open-run-close-measure  proc idb . params)
  (let* ((start-ms (current-milliseconds))
	 (db       (if idb idb (open-db))))
	 (db       (if idb idb (open-db)))
         (throttle (string->number (config-lookup *configdat* "setup" "throttle"))))
    (if (equal? (config-lookup *configdat* "setup"     "synchronous") "yes")
	(sqlite3:execute db "PRAGMA synchronous = 0;"))
    (set! res      (apply proc db params))
    (if (not idb)(sqlite3:finalize! db))
    ;; scale by 10, average with current value.
    (set! *global-delta* (/ (+ *global-delta* (/ (- (current-milliseconds) start-ms) 200)) 2))
    (set! *global-delta* (/ (+ *global-delta* (/ (- (current-milliseconds) start-ms) (if throttle throttle 100))) 2))
    (if (> (abs (- *last-global-delta-printed* *global-delta*)) 0.08) ;; don't print all the time, only if it changes a bit
	(begin
	  (debug:print 1 "INFO: launch throttle factor=" *global-delta*)
	  (set! *last-global-delta-printed* *global-delta*)))
    res))

(define (db:initialize db)
621
622
623
624
625
626
627

628
629
630
631
632
633
634
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636







+







		;;(debug:print 0 "QRY: " qry)
		(sqlite3:execute db qry run-id newstate newstatus testname testname)))
	    testnames))

(define (db:delete-tests-in-state db run-id state)
  (sqlite3:execute db "DELETE FROM tests WHERE state=? AND run_id=?;" state run-id))

;; speed up for common cases with a little logic
(define (db:test-set-state-status-by-id db test-id newstate newstatus newcomment)
  (cond
   ((and newstate newstatus newcomment)
    (sqlite3:exectute db "UPDATE tests SET state=?,status=?,comment=? WHERE id=?;" newstate newstatus test-id))
   ((and newstate newstatus)
    (sqlite3:exectute db "UPDATE tests SET state=?,status=? WHERE id=?;" newstate newstatus test-id))
   (else

Modified tests/fullrun/megatest.config from [a1c0620358] to [cfe8d748dd].

1
2
3
4
5
6
7
8
9
10
11
12
13
14


15
16
17
18
19
20
21
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
21
22













-
+
+







[fields]
sysname TEXT
fsname TEXT
datapath TEXT

# refareas can be searched to find previous runs
# the path points to where megatest.db exists
[refareas]
area1 /tmp/oldarea/megatest

[include config/mt_include_1.config]

[setup]
synchronous yes
synchronous no
throttle 50

[validvalues]
state start end 
status pass fail n/a 0 1 running

# These are set before all tests, override them 
# in the testconfig [pre-launch-env-overrides] section