From 39e4782825241759206d465cdf47646af64916cc Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 2 May 2014 21:41:59 -0400 Subject: [PATCH] Switch to logbook for collecting results --- Makefile | 9 +++------ internal-latency.rkt | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index c6f2fe7..f69330b 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,6 @@ -all: tmp.csv +all: + raco make internal-latency.rkt + PLTSTDERR=warning racket internal-latency.rkt clean: - rm -f tmp.csv rm -rf compiled - -tmp.csv: - raco make internal-latency.rkt - PLTSTDERR=warning racket internal-latency.rkt | tee $@ diff --git a/internal-latency.rkt b/internal-latency.rkt index c4b41b1..f1a6d5a 100644 --- a/internal-latency.rkt +++ b/internal-latency.rkt @@ -3,6 +3,7 @@ (require racket/match) (require minimart) +(require logbook) (struct ping (src dst timestamp) #:transparent) @@ -65,8 +66,14 @@ (module+ main (define t 5000) - (printf "Num echoers,Run duration (ms),Boot delay (ms),Num roundtrips,Msgs/sec,Sec/msg\n") - (flush-output) + (define E (standard-logbook-entry (default-logbook #:verbose? #t) "minimart")) + (define T (logbook-table E "internal-latency" + #:column-spec '(number-of-echoers + secs/msg + msgs/sec + boot-delay-ms + roundtrip-count + run-duration-ms))) ;; Warmup (let () (run #:echoer-count 1 #:run-time 1000) @@ -82,5 +89,9 @@ (collect-garbage) (collect-garbage) (define-values (count v boot-delay-ms) (run #:echoer-count n #:run-time t)) - (printf "~a,~a,~a,~a,~a,~a\n" n t boot-delay-ms count v (/ 1.0 v)) - (flush-output))) + (write-logbook-datum! T (list n + (/ 1.0 v) + v + boot-delay-ms + count + t))))