Megatest

Check-in [015df64528]
Login
Overview
Comment:Caching, rpc all working fairly well
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 015df64528995045768b83d09df218861f6b4c63
User & Date: matt on 2012-02-26 16:19:10
Other Links: manifest | tags
Context
2012-02-26
16:29
Added some time-taking steps to a test check-in: 7996cd995c user: matt tags: trunk
16:19
Caching, rpc all working fairly well check-in: 015df64528 user: matt tags: trunk
16:09
Stand-alone runs now working check-in: a3bcf88b79 user: matt tags: trunk
Changes

Modified db.scm from [8be9b130bc] to [655916f829].

650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
  (mutex-unlock! *incoming-mutex*)
  (if (not *cache-on*)(db:write-cached-data db)))

(define (db:write-cached-data db)
  (let ((meta-stmt (sqlite3:prepare db "UPDATE tests SET cpuload=?,diskfree=?,run_duration=?,state='RUNNING' WHERE run_id=? AND testname=? AND item_path=? AND state NOT IN ('COMPLETED','KILLREQ','KILLED');"))
	(step-stmt (sqlite3:prepare db "INSERT OR REPLACE into test_steps (test_id,stepname,state,status,event_time,comment,logfile) VALUES(?,?,?,?,?,?,?);")) ;; strftime('%s','now')#f)
	(data (sort *incoming-data* (lambda (a b)(< (vector-ref a 1)(vector-ref b 1))))))
    ;(if (> (length data) 0)
(debug:print 0 "Writing cached data " data);)
    (mutex-lock! *incoming-mutex*)
    (for-each (lambda (entry)
		(case (vector-ref entry 0)
		  ((meta-info)
		   (apply sqlite3:execute meta-stmt (vector-ref entry 2)))
		  ((step-status)
		   (apply sqlite3:execute step-stmt (vector-ref entry 2)))







|
|







650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
  (mutex-unlock! *incoming-mutex*)
  (if (not *cache-on*)(db:write-cached-data db)))

(define (db:write-cached-data db)
  (let ((meta-stmt (sqlite3:prepare db "UPDATE tests SET cpuload=?,diskfree=?,run_duration=?,state='RUNNING' WHERE run_id=? AND testname=? AND item_path=? AND state NOT IN ('COMPLETED','KILLREQ','KILLED');"))
	(step-stmt (sqlite3:prepare db "INSERT OR REPLACE into test_steps (test_id,stepname,state,status,event_time,comment,logfile) VALUES(?,?,?,?,?,?,?);")) ;; strftime('%s','now')#f)
	(data (sort *incoming-data* (lambda (a b)(< (vector-ref a 1)(vector-ref b 1))))))
    (if (> (length data) 0)
	(debug:print 4 "Writing cached data " data))
    (mutex-lock! *incoming-mutex*)
    (for-each (lambda (entry)
		(case (vector-ref entry 0)
		  ((meta-info)
		   (apply sqlite3:execute meta-stmt (vector-ref entry 2)))
		  ((step-status)
		   (apply sqlite3:execute step-stmt (vector-ref entry 2)))

Modified server.scm from [c469d03fe2] to [5c480362d7].

45
46
47
48
49
50
51

52
53
54
55
56
57
58
			     (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))))
    (db:set-var db "SERVER" host:port)


    ;; can use this to run most anything at the remote
    (rpc:publish-procedure! 
     'remote:run 
     (lambda (procstr . params)
       (server:autoremote procstr params)))








>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
			     (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))))
    (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)
       (server:autoremote procstr params)))