blocks.summary

A ‘summary’ represents a collection of blocks, including certain statistics about the aggregate count and sizes. These are useful for returning from certain operations to represent the set of blocks acted upon.

The following fields are present in a summary:

  • :count The total number of blocks added to the summary.
  • :size The total size of blocks added to the summary, in bytes.
  • :sizes A histogram map from bucket exponent to a count of the blocks in that bucket (see size->bucket and bucket->range).

bucket->range

(bucket->range n)

Returns a vector with the boundaries which a given size bucket covers.

init

(init)

Construct a new, empty summary.

merge

(merge a b)

Merge two summaries together.

size->bucket

(size->bucket size)

Assigns a block size to an exponential histogram bucket. Given a size s, returns n such that 2^n <= s < 2^(n+1).

update

(update summary block)

Update the summary with the stats from the given block.