Package org.jgroups.util
Class AverageMinMax
- java.lang.Object
-
- org.jgroups.util.Average
-
- org.jgroups.util.AverageMinMax
-
- All Implemented Interfaces:
Streamable
public class AverageMinMax extends Average
Measures min and max in addition to average- Since:
- 4.0, 3.6.10
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected longmaxprotected longminprotected booleansortedprotected java.util.List<java.lang.Long>values-
Fields inherited from class org.jgroups.util.Average
all_filled, DEFAULT_CAPACITY, samples, unit
-
-
Constructor Summary
Constructors Constructor Description AverageMinMax()AverageMinMax(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Average>
Tadd(long num)voidclear()longmax()<T extends Average>
Tmerge(T other)Merges this average with another onelongmin()doublep(double percentile)doublepercentile(double percentile)java.lang.Stringpercentiles()voidreadFrom(java.io.DataInput in)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedAverageMinMaxsort()doublestddev()java.lang.StringtoString()java.lang.StringtoString(java.util.concurrent.TimeUnit u)booleanusePercentiles()AverageMinMaxusePercentiles(int cap)java.util.List<java.lang.Long>values()voidwriteTo(java.io.DataOutput out)Write the entire state of the current object (including superclasses) to outstream.
-
-
-
Method Detail
-
min
public long min()
-
max
public long max()
-
usePercentiles
public boolean usePercentiles()
-
usePercentiles
public AverageMinMax usePercentiles(int cap)
-
values
public java.util.List<java.lang.Long> values()
-
merge
public <T extends Average> T merge(T other)
Description copied from class:AverageMerges this average with another one
-
percentiles
public java.lang.String percentiles()
-
toString
public java.lang.String toString(java.util.concurrent.TimeUnit u)
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOExceptionDescription copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Overrides:
writeToin classAverage- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOExceptionDescription copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classAverage- Throws:
java.io.IOException
-
percentile
public double percentile(double percentile)
-
p
public double p(double percentile)
-
stddev
public double stddev()
-
sort
public AverageMinMax sort()
-
-