Class DistributionSampler
java.lang.Object
org.jgroups.util.DistributionSampler
Records samples (e.g. message sizes or times) by buckets, e.g. 0-10,11-100,101-1000 etc. All buckets are defined at
creation time.
- Since:
- 5.5.0
- Author:
- Bela Ban
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DistributionSampler.Bucket[]protected booleanprotected longprotected long -
Constructor Summary
ConstructorsConstructorDescriptionDistributionSampler(long... buckets) Creates a new samplerDistributionSampler(List<Long> buckets) -
Method Summary
Modifier and TypeMethodDescriptionadd(long value) protected DistributionSampler.BucketbinarySearch(int from, int to, long value) buckets()booleanexceptionOnMissingBucket(boolean b) protected DistributionSampler.BucketgetBucket(long value) protected static long[]listToArray(List<Long> buckets) longmaxValue()longminValue()reset()protected static voidsanityCheck(long... buckets) intsize()toString()longtotal()
-
Field Details
-
buckets
-
min_value
protected long min_value -
max_value
protected long max_value -
exception_on_missing_bucket
protected boolean exception_on_missing_bucket
-
-
Constructor Details
-
DistributionSampler
public DistributionSampler(long... buckets) Creates a new sampler- Parameters:
buckets- The buckets. Needs to be an even number. Each tuple defines min-max size. Needs to be in ascending order of size and adjacent.
-
DistributionSampler
-
-
Method Details
-
minValue
public long minValue() -
maxValue
public long maxValue() -
buckets
-
exceptionOnMissingBucket
public boolean exceptionOnMissingBucket() -
exceptionOnMissingBucket
-
add
-
reset
-
total
public long total() -
size
public int size() -
toString
-
getBucket
-
binarySearch
-
listToArray
-
sanityCheck
protected static void sanityCheck(long... buckets)
-