Skip to content

Commit 7831269

Browse files
committed
test,benchmarks: extract n-benchmarks
1 parent 89d8929 commit 7831269

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

http-easy-test/net/http-easy/benchmarks.rkt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,22 @@
5555
(sort > #:key (λ (ht) (hash-ref ht 'timestamp)))
5656
(keep 5)
5757
(reverse)))
58+
(define n-benchmarks
59+
(length benchmarks))
5860
(parameterize ([plot-y-label "Time (ms)"]
5961
[plot-x-label "Measurements"])
6062
(plot-pict
6163
#:title (~a name)
6264
(for/list ([(bench idx) (in-indexed (in-list benchmarks))])
65+
(define idx+1 (add1 idx))
6366
(define timestamp
6467
(hash-ref bench 'timestamp))
6568
(discrete-histogram
69+
#:line-color idx+1
70+
#:color idx+1
6671
#:label (date->string (seconds->date timestamp) #t)
67-
#:line-color (add1 idx)
68-
#:color (add1 idx)
69-
#:x-min (add1 idx)
70-
#:skip (+ (length benchmarks) 0.5)
72+
#:x-min idx+1
73+
#:skip (+ n-benchmarks 0.5)
7174
(list
7275
(list "Real" (hash-ref bench 'real-time))
7376
(list "CPU" (hash-ref bench 'cpu-time))

0 commit comments

Comments
 (0)