Package org.apache.storm.loadgen
Class NormalDistStats
java.lang.Object
org.apache.storm.loadgen.NormalDistStats
- All Implemented Interfaces:
- Serializable
Stats related to something with a normal distribution, and a way to randomly simulate it.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionNormalDistStats(double mean, double stddev, double min, double max) A Constructor for the pre computed stats.NormalDistStats(List<Double> values) Create an instance of this from a list of values.
- 
Method SummaryModifier and TypeMethodDescriptionstatic NormalDistStatsRead the stats from a config.static NormalDistStatsRead the stats from a config.doublenextRandom(Random rand) Generate a random number that follows the statistical distribution.scaleBy(double v) Scale the stats by v.toConf()Return this as a config.toString()
- 
Field Details- 
meanpublic final double mean
- 
stddevpublic final double stddev
- 
minpublic final double min
- 
maxpublic final double max
 
- 
- 
Constructor Details- 
NormalDistStatsCreate an instance of this from a list of values. The metrics will be computed from the values.- Parameters:
- values- the values to compute metrics from.
 
- 
NormalDistStatspublic NormalDistStats(double mean, double stddev, double min, double max) A Constructor for the pre computed stats.- Parameters:
- mean- the mean of the values.
- stddev- the standard deviation of the values.
- min- the min of the values.
- max- the max of the values.
 
 
- 
- 
Method Details- 
fromConfRead the stats from a config.- Parameters:
- conf- the config.
- Returns:
- the corresponding stats.
 
- 
fromConfRead the stats from a config.- Parameters:
- conf- the config.
- def- the default mean.
- Returns:
- the corresponding stats.
 
- 
toConfReturn this as a config.- Returns:
- the config version of this.
 
- 
nextRandomGenerate a random number that follows the statistical distribution.- Parameters:
- rand- the random number generator to use
- Returns:
- the next number that should follow the statistical distribution.
 
- 
toString
- 
scaleByScale the stats by v. This is not scaling everything proportionally. We don't want the stddev to increase so instead we scale the mean and shift everything up or down by the same amount.- Parameters:
- v- the amount to scale by 1.0 is nothing 0.5 is half.
- Returns:
- a copy of this with the needed adjustments.
 
 
-