Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -645,15 +645,27 @@ ;; ;; General info about the run(s) and megatest area (define (dashboard:summary) (let ((rawconfig (read-config (conc *toppath* "/megatest.config") #f 'return-string))) (iup:vbox - (iup:hbox - (dcommon:general-info) - (dcommon:keys-matrix rawconfig)) - (dcommon:section-matrix rawconfig "setup" "Varname" "Value") - (dcommon:run-stats)))) + (iup:frame + #:title "General Info" + (iup:hbox + (dcommon:general-info) + (dcommon:keys-matrix rawconfig))) + (iup:frame + #:title "Megatest config settings" + (iup:hbox + (dcommon:section-matrix rawconfig "setup" "Varname" "Value") + (iup:vbox + (dcommon:section-matrix rawconfig "server" "Varname" "Value") + ;; (iup:frame + ;; #:title "Disks Areas" + (dcommon:section-matrix rawconfig "disks" "Disk area" "Path")))) + (iup:frame + #:title "Run statistics" + (dcommon:run-stats))))) ;;====================================================================== ;; R U N S ;;====================================================================== Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -682,16 +682,21 @@ ;; get some basic run stats ;; ;; ( (runname (( state count ) ... )) ;; ( ... (define (db:get-run-stats db) - (let ((res '())) + (let ((totals (make-hash-table)) + (res '())) (sqlite3:for-each-row (lambda (runname state count) + (hash-table-set! totals state (+ (hash-table-ref/default totals state 0) count)) (set! res (cons (list runname state count) res))) db - "SELECT runname,t.state,count(t.id) FROM runs AS r INNER JOIN tests AS t ON r.id=t.run_id GROUP BY t.state,runname;" ) + "SELECT runname,t.state||'/'||t.status AS s,count(t.id) FROM runs AS r INNER JOIN tests AS t ON r.id=t.run_id GROUP BY s,runname;" ) + (for-each (lambda (state) + (set! res (cons (list "Totals" state (hash-table-ref totals state)) res))) + (hash-table-keys totals)) res)) ;; db:get-runs-by-patt ;; get runs by list of criteria ;; register a test run with the db Index: dcommon.scm ================================================================== --- dcommon.scm +++ dcommon.scm @@ -33,16 +33,16 @@ (define (dcommon:keys-matrix rawconfig) (let* ((curr-row-num 1) (key-vals (configf:section-vars rawconfig "fields")) (keys-matrix (iup:matrix #:alignment1 "ALEFT" - #:expand "HORIZONTAL" ;; "VERTICAL" + #:expand "YES" ;; "HORIZONTAL" ;; "VERTICAL" ;; #:scrollbar "YES" #:numcol 1 #:numlin (length key-vals) #:numcol-visible 1 - #:numlin-visible 5 + #:numlin-visible (length key-vals) #:click-cb (lambda (obj lin col status) (print "obj: " obj " lin: " lin " col: " col " status: " status))))) (iup:attribute-set! keys-matrix "0:0" "Run Keys") (iup:attribute-set! keys-matrix "0:1" "Key Name") (iup:attribute-set! keys-matrix "WIDTH1" "100") @@ -60,15 +60,15 @@ (define (dcommon:section-matrix rawconfig sectionname varcolname valcolname #!key (title #f)) (let* ((curr-row-num 1) (key-vals (configf:section-vars rawconfig sectionname)) (section-matrix (iup:matrix #:alignment1 "ALEFT" - #:expand "HORIZONTAL" ;; "YES" + #:expand "YES" ;; "HORIZONTAL" #:numcol 1 #:numlin (length key-vals) #:numcol-visible 1 - #:numlin-visible 5 + #:numlin-visible (length key-vals) #:scrollbar "YES"))) (iup:attribute-set! section-matrix "0:0" varcolname) (iup:attribute-set! section-matrix "0:1" valcolname) (iup:attribute-set! section-matrix "WIDTH1" "300") ;; fill in keys @@ -80,19 +80,20 @@ (set! curr-row-num (+ 1 curr-row-num))) ;; (config-lookup *configdat* "fields" var))) key-vals) (iup:vbox (iup:label (if title title (conc "Settings from [" sectionname "]")) #:size "5x" - #:expand "HORIZONTAL") + #:expand "HORIZONTAL" + ) section-matrix))) ;; General data ;; (define (dcommon:general-info) (let ((general-matrix (iup:matrix #:alignment1 "ALEFT" - #:expand "HORIZONTAL" ;; "YES" + #:expand "YES" ;; "HORIZONTAL" #:numcol 1 #:numlin 3 #:numcol-visible 1 #:numlin-visible 3))) (iup:attribute-set! general-matrix "WIDTH1" "300") @@ -111,17 +112,18 @@ (define (dcommon:run-stats) (let* ((run-stats (mt:get-run-stats)) (indices (common:sparse-list-generate-index run-stats)) ;; proc: set-cell)) (max-row (apply max (map cadr (car indices)))) (max-col (apply max (map cadr (cadr indices)))) + (max-visible (max (- *num-tests* 15) 3)) (stats-matrix (iup:matrix #:alignment1 "ALEFT" - #:expand "HORIZONTAL" + #:expand "YES" ;; "HORIZONTAL" #:numcol max-col - #:numlin (if (< max-row 20) 20 max-row) ;; min of 20 + #:numlin (if (< max-row max-visible) max-visible max-row) ;; min of 20 #:numcol-visible max-col - #:numlin-visible (if (> max-row 20) 20 max-row))) + #:numlin-visible (if (> max-row max-visible) max-visible max-row))) (numrows 1) (numcols 1) (set-cell (lambda (rnum cnum rname cname v) ;; rownum colnum value (print "proc called: " rnum " " cnum " " rname " " cname " " v) (if (> rnum numrows)