Package io.opencensus.metrics.export
Class Distribution.BucketOptions
- java.lang.Object
-
- io.opencensus.metrics.export.Distribution.BucketOptions
-
- Direct Known Subclasses:
Distribution.BucketOptions.ExplicitOptions
- Enclosing class:
- Distribution
@Immutable public abstract static class Distribution.BucketOptions extends java.lang.Object
The bucket options used to create a histogram for the distribution.- Since:
- 0.17
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Distribution.BucketOptions.ExplicitOptions
A Bucket with explicit boundsDistribution.BucketOptions
.
-
Constructor Summary
Constructors Modifier Constructor Description private
BucketOptions()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Distribution.BucketOptions
explicitOptions(java.util.List<java.lang.Double> bucketBoundaries)
Returns aDistribution.BucketOptions.ExplicitOptions
.abstract <T> T
match(Function<? super Distribution.BucketOptions.ExplicitOptions,T> explicitFunction, Function<? super Distribution.BucketOptions,T> defaultFunction)
Applies the given match function to the underlying BucketOptions.
-
-
-
Method Detail
-
explicitOptions
public static Distribution.BucketOptions explicitOptions(java.util.List<java.lang.Double> bucketBoundaries)
Returns aDistribution.BucketOptions.ExplicitOptions
.The bucket boundaries for that histogram are described by bucket_bounds. This defines size(bucket_bounds) + 1 (= N) buckets. The boundaries for bucket index i are:
[0, bucket_bounds[i]) for i == 0
[bucket_bounds[i-1], bucket_bounds[i]) for 0 < i < N-1
[bucket_bounds[i-1], +infinity) for i == N-1
If bucket_bounds has no elements (zero size), then there is no histogram associated with the Distribution. If bucket_bounds has only one element, there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. The values must be monotonically increasing.
- Parameters:
bucketBoundaries
- the bucket boundaries of a distribution (given explicitly). The values must be strictly increasing and should be positive values.- Returns:
- a
ExplicitOptions
BucketOptions
. - Since:
- 0.17
-
match
public abstract <T> T match(Function<? super Distribution.BucketOptions.ExplicitOptions,T> explicitFunction, Function<? super Distribution.BucketOptions,T> defaultFunction)
Applies the given match function to the underlying BucketOptions.- Parameters:
explicitFunction
- the function that should be applied if the BucketOptions has typeExplicitOptions
.defaultFunction
- the function that should be applied if the BucketOptions has a type that was added after thismatch
method was added to the API. SeeFunctions
for some common functions for handling unknown types.- Returns:
- the result of the function applied to the underlying BucketOptions.
- Since:
- 0.17
-
-