add something that tracks the size of .zo files over time
(this is for our benefit via drdr)
This commit is contained in:
parent
011f47540d
commit
4da6b0904e
23
collects/meta/zo-size.rkt
Normal file
23
collects/meta/zo-size.rkt
Normal file
|
@ -0,0 +1,23 @@
|
|||
#lang racket
|
||||
|
||||
(define ht (make-hash))
|
||||
|
||||
(for ([lcp (current-library-collection-paths)])
|
||||
(when (directory-exists? lcp)
|
||||
(for ([coll (in-list (directory-list lcp))])
|
||||
(define coll-path (build-path lcp coll))
|
||||
(when (directory-exists? coll-path)
|
||||
(hash-set! ht
|
||||
(path->string coll)
|
||||
(for/sum ([file (in-directory (build-path lcp coll))]
|
||||
#:when (regexp-match? #rx"[.]zo$" (path->string file)))
|
||||
(file-size file)))))))
|
||||
|
||||
(define total (for/sum ([(k v) (in-hash ht)]) v))
|
||||
(printf "The 'time' line is to trick drdr into graphing\n")
|
||||
(printf "the size of all of the .zo files, in bytes\n")
|
||||
(printf "cpu time: ~a real time: ~a gc time: ~a\n" total total total)
|
||||
(printf "This is the breakdown by collection\n")
|
||||
(sort (hash-map ht list)
|
||||
string<=?
|
||||
#:key car)
|
Loading…
Reference in New Issue
Block a user