Index: tcp-transportmod.scm ================================================================== --- tcp-transportmod.scm +++ tcp-transportmod.scm @@ -41,10 +41,11 @@ ports posix files data-structures + directory-utils tcp )) (chicken-5 (import chicken.base chicken.condition @@ -1128,7 +1129,29 @@ (define (get-all-ips) (map address-info-host (filter (lambda (x) (equal? (address-info-type x) "tcp")) (address-infos (get-host-name))))) + +;;====================================================================== +;; Other Utils +;;====================================================================== + +;; 1.db => (10 . 9) ;; (total . hits) +(define *journal-stats* (make-hash-table)) + +;; monte-carlo-esque random sampling of journal files +;; for all the files: +;; if .journal +;; update stats +1 +1 +;; update stats +1 0 +;; +(define (tt:write-load-tracking dbdir) + (let* ((cs (current-seconds)) + (key (inexact->exact (quotient cs 10)))) + (directory-fold + dbdir + (lambda (res fname) + (cons fname res)) + '()))) )