Class Histogram.ConstantBinScheme
java.lang.Object
org.apache.kafka.common.metrics.stats.Histogram.ConstantBinScheme
- All Implemented Interfaces:
- Histogram.BinScheme
- Enclosing class:
- Histogram
A scheme for calculating the bins where the width of each bin is a constant determined by the range of values
 and the number of bins.
- 
Constructor SummaryConstructorsConstructorDescriptionConstantBinScheme(int bins, double min, double max) Create a bin scheme with the specified number of bins that all have the same width.
- 
Method Summary
- 
Constructor Details- 
ConstantBinSchemepublic ConstantBinScheme(int bins, double min, double max) Create a bin scheme with the specified number of bins that all have the same width.- Parameters:
- bins- the number of bins; must be at least 2
- min- the minimum value to be counted in the bins
- max- the maximum value to be counted in the bins
 
 
- 
- 
Method Details- 
binspublic int bins()Description copied from interface:Histogram.BinSchemeGet the number of bins.- Specified by:
- binsin interface- Histogram.BinScheme
- Returns:
- the number of bins
 
- 
fromBinpublic double fromBin(int b) Description copied from interface:Histogram.BinSchemeDetermine the value at the upper range of the specified bin.- Specified by:
- fromBinin interface- Histogram.BinScheme
- Parameters:
- b- the 0-based bin number
- Returns:
- the value at the upper end of the bin; or negative infinityif the bin number is negative orpositive infinityif the 0-based bin number is greater than or equal to thenumber of bins.
 
- 
toBinpublic int toBin(double x) Description copied from interface:Histogram.BinSchemeDetermine the 0-based bin number in which the supplied value should be placed.- Specified by:
- toBinin interface- Histogram.BinScheme
- Parameters:
- x- the value
- Returns:
- the 0-based index of the bin
 
 
-