@@ -346,10 +346,19 @@ (debug:print 0 "WARNING: -itempatt has been deprecated, please use -testpatt testpatt/itempatt method, new testpatt is "newval) (hash-table-set! args:arg-hash "-testpatt" newval) (hash-table-delete! args:arg-hash "-itempatt"))) (on-exit (lambda () + (debug:print 18 "DB Stats") + (debug:print 18 "Cmd\tCount\tTot time\tAvg") + (for-each (lambda (cmd) + (let ((cmd-dat (hash-table-ref *db-stats* cmd))) + (debug:print 18 cmd "\t" (vector-ref cmd-dat 0) "\t" (vector-ref cmd-dat 1) "\t" (/ (vector-ref cmd-dat 1) (vector-ref cmd-dat 0))))) + (sort (hash-table-keys *db-stats*) + (lambda (a b) + (> (vector-ref (hash-table-ref *db-stats* a) 0) + (vector-ref (hash-table-ref *db-stats* b) 0))))) (if *dbstruct-db* (db:close-all *dbstruct-db*)) (if *megatest-db* (sqlite3:finalize! *megatest-db*)))) ;;====================================================================== ;; Misc general calls