Mini stats toolkit for Clojure/Script.
Mini stats toolkit for Clojure/Script.
(rolling-summary-stats)
(rolling-summary-stats {:keys [buffer-size buffer-init sstats-init merge-cb]
:or {buffer-size 100000.0}
:as opts})
EXPERIMENTAL, SUBJECT TO CHANGE! Returns a stateful RollingSummaryStats: (rss <num>) => Adds given number to internal buffer. (deref rss) => Flushes buffer if necessary, and returns a ?map of summary stats for all numbers ever added to rss: {:keys [n min max p25 ... p99 mean var mad]}.
Useful for summarizing any (possibly infinite) stream of numbers. Used by the Tufte profiling library, and the Carmine Redis library.
Options: :buffer-size - The maximum number of numbers that may be buffered before next (rss <num>) call will block to flush buffer and merge with any existing summary stats.
Larger buffers mean better performance and more
accurate stats, at the cost of more memory use.
:buffer-init - Initial buffer content, useful for persistent rss. :sstats-init - Initial summary stats, useful for persistent rss.
EXPERIMENTAL, SUBJECT TO CHANGE! Returns a stateful RollingSummaryStats: (rss <num>) => Adds given number to internal buffer. (deref rss) => Flushes buffer if necessary, and returns a ?map of summary stats for all numbers ever added to rss: {:keys [n min max p25 ... p99 mean var mad]}. Useful for summarizing any (possibly infinite) stream of numbers. Used by the Tufte profiling library, and the Carmine Redis library. Options: :buffer-size - The maximum number of numbers that may be buffered before next (rss <num>) call will block to flush buffer and merge with any existing summary stats. Larger buffers mean better performance and more accurate stats, at the cost of more memory use. :buffer-init - Initial buffer content, useful for persistent rss. :sstats-init - Initial summary stats, useful for persistent rss.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close