Class DistributionSampler


  • public class DistributionSampler
    extends java.lang.Object
    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.4.9
    Author:
    Bela Ban
    • Field Detail

      • min_value

        protected long min_value
      • max_value

        protected long max_value
      • exception_on_missing_bucket

        protected boolean exception_on_missing_bucket
    • Constructor Detail

      • 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

        public DistributionSampler​(java.util.List<java.lang.Long> buckets)
    • Method Detail

      • minValue

        public long minValue()
      • maxValue

        public long maxValue()
      • exceptionOnMissingBucket

        public boolean exceptionOnMissingBucket()
      • exceptionOnMissingBucket

        public DistributionSampler exceptionOnMissingBucket​(boolean b)
      • total

        public long total()
      • size

        public int size()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • listToArray

        protected static long[] listToArray​(java.util.List<java.lang.Long> buckets)
      • sanityCheck

        protected static void sanityCheck​(long... buckets)