Histogram

class Histogram

A log-linear histogram of non-negative values (microseconds here), the recorder of the load generator: the same bucketing HdrHistogram uses, without the dependency.

Values below 2^(SUB_BITS + 1) each have a bucket of their own. Above, each power of two is split into 2^SUB_BITS equal buckets, so a bucket is at most 1 / 2^SUB_BITS of its values wide: with 7 bits, a percentile is within 0.8% of the value recorded. Values above MAX_VALUE are counted in the last bucket; the exact max is kept beside the buckets. Recording is lock-free and safe from any thread.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val count: Long
Link copied to clipboard
val max: Long
Link copied to clipboard

Functions

Link copied to clipboard
fun add(other: Histogram)

Adds every value of other to this histogram.

Link copied to clipboard

The non-empty buckets as [lowest value, highest value, count], for the raw results.

Link copied to clipboard
fun percentile(percentile: Double): Long

The value at percentile (0 to 100): the highest value of the bucket that holds the value of that rank, at most max; 0 when nothing was recorded.

Link copied to clipboard
fun record(value: Long)