HdrHistogram.HistogramBase.LowestEquivalentValue C# (CSharp) Method

LowestEquivalentValue() public method

Get the lowest value that is equivalent to the given value within the histogram's resolution. Where "equivalent" means that value samples recorded for any two equivalent values are counted in a common total count.
public LowestEquivalentValue ( long value ) : long
value long The given value
return long
        public long LowestEquivalentValue(long value)
        {
            var bucketIndex = GetBucketIndex(value);
            var subBucketIndex = GetSubBucketIndex(value, bucketIndex);
            return ValueFromIndex(bucketIndex, subBucketIndex);
        }

Usage Example

        /// <summary>
        /// Get the lowest recorded value level in the histogram
        /// </summary>
        /// <returns>the Min value recorded in the histogram</returns>
        public static long GetMinValue(this HistogramBase histogram)
        {
            var min = histogram.RecordedValues().Select(hiv => hiv.ValueIteratedTo).FirstOrDefault();

            return(histogram.LowestEquivalentValue(min));
        }