An interface for bucketing algorithms for histograms.

It's responsible to calculate the bucket a sample goes into. It can calculate buckets on-the-fly or pre-calculate buckets and re-use that when needed.

Implements

Constructors

Properties

bucketCount: number
bucketRanges: number[]
max: number
min: number

Methods

  • Get the bucket for the sample.

    This uses a binary search to locate the index i of the bucket such that: bucket[i] <= sample < bucket[i+1].

    Parameters

    • sample: number

      The value that we will find a bucket for.

    Returns number

    The bucket that the sample will be placed in.

Generated using TypeDoc