SummaryStats stuff. Private ns, implementation detail.
SummaryStats stuff. Private ns, implementation detail.
(ssb-clear _)
Clears all internal state and returns nil.
Clears all internal state and returns nil.
(ssb-deref _)
(ssb-deref _ flush-buffer?)
Returns current ?sstats.
Returns current ?sstats.
(ssb-flush _)
Flushes internal buffer and returns newly merged sstats or nil.
Flushes internal buffer and returns newly merged sstats or nil.
(ssb-push _ n)
Adds given num to internal buffer.
Adds given num to internal buffer.
(summary-stats nums)
Given a coll of numbers, returns a new mergeable ?SummaryStats with: (deref ss) => {:keys [n min max p25 ... p99 mean var mad]}
See also summary-stats-merge
.
Given a coll of numbers, returns a new mergeable ?SummaryStats with: (deref ss) => {:keys [n min max p25 ... p99 mean var mad]} See also `summary-stats-merge`.
(summary-stats-buffered)
(summary-stats-buffered {:keys [buffer-size buffer-init sstats-init merge-cb]
:or {buffer-size 100000.0}
:as opts})
Returns a new stateful SummaryStatsBuffered with: (ssb <num>) => Adds given number to internal buffer. (deref ssb) => Flushes buffer if necessary, and returns a mergeable ?SummaryStats. Deref again to get a map of summary stats for all numbers ever added to ssb: {:keys [n min max p25 ... p99 mean var mad]}.
Useful for summarizing a (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 (ssb <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
while buffering.
:buffer-init - Initial buffer content, useful for persistent ssb. :sstats-init - Initial summary stats, useful for persistent ssb.
Returns a new stateful SummaryStatsBuffered with: (ssb <num>) => Adds given number to internal buffer. (deref ssb) => Flushes buffer if necessary, and returns a mergeable ?SummaryStats. Deref again to get a map of summary stats for all numbers ever added to ssb: {:keys [n min max p25 ... p99 mean var mad]}. Useful for summarizing a (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 (ssb <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 while buffering. :buffer-init - Initial buffer content, useful for persistent ssb. :sstats-init - Initial summary stats, useful for persistent ssb.
(summary-stats-buffered-fast buffer-size merge-cb)
Returns fastest possible SummaryStatsBuffered.
Returns fastest possible SummaryStatsBuffered.
(summary-stats-buffered? x)
Returns true iff given a SummaryStatsBuffered argument.
Returns true iff given a SummaryStatsBuffered argument.
(summary-stats-merge ss1)
(summary-stats-merge ss1 ss2)
Given one or more SummaryStats, returns a new ?SummaryStats with: (summary-stats-merge (summary-stats nums1) (summary-stats nums2))
an approximatation of (summary-stats (merge nums1 nums2))
Useful when you want summary stats for a large coll of numbers for which it would be infeasible/expensive to keep all numbers for accurate merging.
Given one or more SummaryStats, returns a new ?SummaryStats with: (summary-stats-merge (summary-stats nums1) (summary-stats nums2)) an approximatation of (summary-stats (merge nums1 nums2)) Useful when you want summary stats for a large coll of numbers for which it would be infeasible/expensive to keep all numbers for accurate merging.
(summary-stats? x)
Returns true iff given a SummaryStats argument.
Returns true iff given a SummaryStats argument.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close