#[non_exhaustive]pub enum BucketOption {
LinearBuckets(Box<LinearBuckets>),
ExponentialBuckets(Box<ExponentialBuckets>),
ExplicitBuckets(Box<ExplicitBuckets>),
}Expand description
Defines the buckets in the histogram. bucket_option and bucket_counts
must be both set, or both unset.
Buckets are numbered in the range of [0, N], with a total of N+1 buckets.
There must be at least two buckets (a single-bucket histogram gives
no information that isn’t already provided by count).
The first bucket is the underflow bucket which has a lower bound of -inf. The last bucket is the overflow bucket which has an upper bound of +inf. All other buckets (if any) are called “finite” buckets because they have finite lower and upper bounds. As described below, there are three ways to define the finite buckets.
(1) Buckets with constant width. (2) Buckets with exponentially growing widths. (3) Buckets with arbitrary user-provided widths.
In all cases, the buckets cover the entire real number line (-inf, +inf). Bucket upper bounds are exclusive and lower bounds are inclusive. The upper bound of the underflow bucket is equal to the lower bound of the smallest finite bucket; the lower bound of the overflow bucket is equal to the upper bound of the largest finite bucket.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LinearBuckets(Box<LinearBuckets>)
Buckets with constant width.
ExponentialBuckets(Box<ExponentialBuckets>)
Buckets with exponentially growing width.
ExplicitBuckets(Box<ExplicitBuckets>)
Buckets with arbitrary user-provided width.
Trait Implementations§
Source§impl Clone for BucketOption
impl Clone for BucketOption
Source§fn clone(&self) -> BucketOption
fn clone(&self) -> BucketOption
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more