public final class BucketFunctions
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.function.LongFunction<java.lang.String> |
age(long max,
java.util.concurrent.TimeUnit unit)
Returns a function that maps age values to a set of buckets.
|
static java.util.function.LongFunction<java.lang.String> |
ageBiasOld(long max,
java.util.concurrent.TimeUnit unit)
Returns a function that maps age values to a set of buckets.
|
static java.util.function.LongFunction<java.lang.String> |
bytes(long max)
Returns a function that maps size values in bytes to a set of buckets.
|
static java.util.function.LongFunction<java.lang.String> |
decimal(long max)
Returns a function that maps size values to a set of buckets.
|
static java.util.function.LongFunction<java.lang.String> |
latency(long max,
java.util.concurrent.TimeUnit unit)
Returns a function that maps latencies to a set of buckets.
|
static java.util.function.LongFunction<java.lang.String> |
latencyBiasSlow(long max,
java.util.concurrent.TimeUnit unit)
Returns a function that maps latencies to a set of buckets.
|
public static java.util.function.LongFunction<java.lang.String> age(long max, java.util.concurrent.TimeUnit unit)
max
- Maximum expected age of data flowing through. Values greater than this max will be mapped
to an "old" bucket.unit
- Unit for the max value.public static java.util.function.LongFunction<java.lang.String> latency(long max, java.util.concurrent.TimeUnit unit)
System.currentTimeMillis()
to measure the latency and having a
time adjustment between the start and end. In addition to a bucket at the max, it will create
buckets at max / 2, max / 4, and max / 8.max
- Maximum expected age of data flowing through. Values greater than this max will be mapped
to an "old" bucket.unit
- Unit for the max value.public static java.util.function.LongFunction<java.lang.String> ageBiasOld(long max, java.util.concurrent.TimeUnit unit)
max
- Maximum expected age of data flowing through. Values greater than this max will be mapped
to an "old" bucket.unit
- Unit for the max value.public static java.util.function.LongFunction<java.lang.String> latencyBiasSlow(long max, java.util.concurrent.TimeUnit unit)
System.currentTimeMillis()
to measure the latency and having a
time adjustment between the start and end. In addition to a bucket at the max, it will create
buckets at max - max / 8, max - max / 4, and max - max / 2.max
- Maximum expected age of data flowing through. Values greater than this max will be mapped
to an "old" bucket.unit
- Unit for the max value.public static java.util.function.LongFunction<java.lang.String> bytes(long max)
decimal(long)
.max
- Maximum expected size of data being recorded. Values greater than this amount will be
mapped to a "large" bucket.public static java.util.function.LongFunction<java.lang.String> decimal(long max)
bytes(long)
.max
- Maximum expected size of data being recorded. Values greater than this amount will be
mapped to a "large" bucket.