Megatest

Diff
Login

Differences From Artifact [8d71943f1e]:

To Artifact [72fd2eb38f]:


724
725
726
727
728
729
730
731

732
733
734
735
736
737
738
739
740
741

742
743
744
745
746
747
748
724
725
726
727
728
729
730

731
732
733
734
735
736
737
738
739
740

741
742
743
744
745
746
747
748







-
+









-
+







    ;; Update central with uname and hostname = #f
    ;; Is this one of the performance problems? This info should come from testdat-meta anyway
    ;; (tests:update-central-meta-info test-id cpuload diskfree minutes #f #f)
  ))
	 
(define (tests:update-testdat-meta-info db test-id work-area cpuload diskfree minutes)
  (let ((tdb         (db:open-test-db-by-test-id db test-id work-area: work-area)))
    (if tdb
    (if (sqlite3:database? tdb)
	(begin
	  (sqlite3:execute tdb "INSERT INTO test_rundat (update_time,cpuload,diskfree,run_duration) VALUES (strftime('%s','now'),?,?,?);"
			   cpuload diskfree minutes)
	  (sqlite3:finalize! tdb))
	(debug:print 2 "Can't update testdat.db for test " test-id " read-only or non-existant"))))
    
(define (tests:testdat-get-testinfo db test-id work-area)
   (let ((tdb         (db:open-test-db-by-test-id db test-id work-area: work-area))
	 (res         '()))
     (if tdb
     (if (sqlite3:database? tdb)
	 (sqlite3:for-each-row
	  (lambda (update-time cpuload diskfree run-duration)
	    (set! res (cons (vector update-time cpuload diskfree run-duration) res)))
	  tdb
	  "SELECT update_time,cpuload,diskfree,run_duration FROM test_rundat ORDER BY update_time ASC;")
	 (sqlite3:finalize! tdb))
     res))