Stats stuff. Private ns, implementation detail.
Stats stuff. Private ns, implementation detail.
(doubles? x)
Returns true iff given double array
Returns true iff given double array
(get-max-id-width id-sstats*
{:keys [format-id-fn]
:or {format-id-fn default-format-id-fn}})
(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.
(longs? x)
Returns true iff given long array
Returns true iff given long array
(multi-reduce f init coll)
(multi-reduce f1 init1 f2 init2 coll)
(multi-reduce f1 init1 f2 init2 f3 init3 coll)
Like reduce
but supports separate simultaneous accumulators
as a micro-optimisation when reducing a large collection multiple
times.
Like `reduce` but supports separate simultaneous accumulators as a micro-optimisation when reducing a large collection multiple times.
(percentiles nums)
Returns ?[min p25 p50 p75 p90 p95 p99 max] doubles in:
Returns ?[min p25 p50 p75 p90 p95 p99 max] doubles in: - O(1) for Sorted types (SortedLongs, SortedDoubles), - O(n.log_n) otherwise.
(summary-stats nums-or-ss-map)
Given a coll of numbers or previously dereffed SummaryStats map, 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 or previously dereffed SummaryStats map, 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.
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. 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 instance.
Returns true iff given a SummaryStatsBuffered instance.
(summary-stats-clear! stateful-summary-stats)
Clears internal state (incl. stats and buffers, etc.) for given stateful SummaryStats instance and returns nil.
Clears internal state (incl. stats and buffers, etc.) for given stateful SummaryStats instance and returns nil.
(summary-stats-format clock-total
id-sstats*
{:keys [columns sort-fn format-id-fn max-id-width]
:as opts
:or {columns default-format-columns
sort-fn (fn [ss] (get (enc/force-ref ss) :sum))
format-id-fn default-format-id-fn}})
Given {<id> <sstats>} or {<id> <sstats-map>}, returns a formatted table string. Assumes nanosecond clock, and stats based on profiling id'd nanosecond times.
Given {<id> <sstats>} or {<id> <sstats-map>}, returns a formatted table string. Assumes nanosecond clock, and stats based on profiling id'd nanosecond times.
(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-stateful? x)
Returns true iff given a stateful SummaryStats instance.
Returns true iff given a stateful SummaryStats instance.
(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