|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.servo.stats.StatsBuffer
public class StatsBuffer
A simple circular buffer that records values, and computes useful stats. This implementation is not thread safe.
| Constructor Summary | |
|---|---|
StatsBuffer(int size,
double[] percentiles)
Create a circular buffer that will be used to record values and compute useful stats |
|
| Method Summary | |
|---|---|
void |
computeStats()
Compute stats for the current set of values. |
int |
getCount()
Get the number of entries recorded. |
long |
getMax()
Get the max of the values currently in our buffer. |
double |
getMean()
Get the average of the values recorded. |
long |
getMin()
Get the minimum of the values currently in our buffer. |
double[] |
getPercentiles()
Return the percentiles we will compute: For example: 95.0, 99.0. |
double[] |
getPercentileValues()
Get the computed percentileValues. |
double |
getStdDev()
Get the standard deviation for the population of the recorded values present in our buffer. |
long |
getTotalTime()
Get the total sum of the values recorded. |
double |
getVariance()
Get the variance for the population of the recorded values present in our buffer. |
void |
record(long n)
Record a new value for this buffer. |
void |
reset()
Reset our local state: All values are set to 0. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatsBuffer(int size,
double[] percentiles)
size - The capacity of the bufferpercentiles - Array of percentiles to compute. For example { 95.0, 99.0 }. If no percentileValues are required
pass a 0-sized array.| Method Detail |
|---|
public void reset()
public void record(long n)
public void computeStats()
public int getCount()
public double getMean()
public double getVariance()
public double getStdDev()
public long getMin()
public long getMax()
public long getTotalTime()
public double[] getPercentileValues()
StatsConfig for how to request different
percentileValues. Note that for efficiency reasons we return the actual array of computed values.
Users must NOT modify this array.
public double[] getPercentiles()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||