Package org.apache.cassandra.utils
Class HistogramBuilder
java.lang.Object
org.apache.cassandra.utils.HistogramBuilder
Simple class for constructing an EsimtatedHistogram from a set of predetermined values
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(long value) buildWithStdevRangesAroundMean(int maxdevs) Calculate the min, mean, max and standard deviation of the items in the builder, and generate an EstimatedHistogram with uptomaxdevstdev size ranges either side of the mean, until min/max are hit; if either min/max are not reached a further range is inserted at the relevant ends.
-
Field Details
-
EMPTY_LONG_ARRAY
public static final long[] EMPTY_LONG_ARRAY -
ZERO
public static final long[] ZERO
-
-
Constructor Details
-
HistogramBuilder
public HistogramBuilder() -
HistogramBuilder
public HistogramBuilder(long[] values)
-
-
Method Details
-
add
public void add(long value) -
buildWithStdevRangesAroundMean
- Returns:
- buildWithStdevRangesAroundMean(3)
-
buildWithStdevRangesAroundMean
Calculate the min, mean, max and standard deviation of the items in the builder, and generate an EstimatedHistogram with uptomaxdevstdev size ranges either side of the mean, until min/max are hit; if either min/max are not reached a further range is inserted at the relevant ends. e.g., with amaxdevsof 3, there may be up to 8 ranges (between 9 boundaries, the middle being the mean); the middle 6 will have the same size (stdev) with the outermost two stretching out to min and max.- Parameters:
maxdevs-- Returns:
-