public class Percentiler extends Object
| Constructor and Description |
|---|
Percentiler()
Creates an empty percentiler.
|
Percentiler(byte[] data)
Creates a percentiler from its serialized representation.
|
Percentiler(int min,
int max)
Creates a percentiler that expects values to fall within the given range.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearModified()
Clears this percentiler's "is modified" state.
|
void |
dump(PrintWriter out)
Dumps a text representation of this percentiler to the supplied print stream.
|
void |
dumpGnuPlot(PrintWriter out)
Dumps out our data in a format that can be used to generate a gnuplot.
|
int[] |
getCounts()
Returns the counts for each bucket.
|
int |
getMaxScore()
Returns the largest score seen by this percentiler.
|
int |
getMinScore()
Returns the smallest score seen by this percentiler.
|
int |
getPercentile(float value)
Returns the percent of all numbers seen that are lower than the specified value.
|
long |
getRecordedCount()
Returns the total number of values ever recorded to this percentiler.
|
float |
getRequiredScore(int percentile)
Returns the score necessary to attain the specified percentile.
|
float[] |
getRequiredScores()
Returns the scores required to obtain a percentile rating from 0 to 99.
|
boolean |
isModified()
Returns true if thsi percentiler has been modified since it was created or since the last
call to
clearModified(). |
void |
recomputePercentiles()
Recomputes the percentile cutoffs based on the values recorded since the last percentile
computation.
|
void |
recordValue(float value)
Records a value, updating the histogram but not the percentiles (a call to
recomputePercentiles() is required for that and is sufficiently expensive that it shouldn't
be done every time a value is added). |
void |
recordValue(float value,
boolean logNewMax)
See
recordValue(float). |
byte[] |
toBytes()
Converts this percentiler to a byte array so that it may be stored into a database.
|
String |
toString() |
public Percentiler()
public Percentiler(int min,
int max)
public Percentiler(byte[] data)
public void recordValue(float value)
recomputePercentiles() is required for that and is sufficiently expensive that it shouldn't
be done every time a value is added).public void recordValue(float value,
boolean logNewMax)
recordValue(float).public long getRecordedCount()
public boolean isModified()
clearModified().public void clearModified()
public int getPercentile(float value)
recomputePercentiles().public float getRequiredScore(int percentile)
recomputePercentiles().percentile - the desired percentile (from 0 to 99 inclusive).public int getMaxScore()
public int getMinScore()
public float[] getRequiredScores()
public int[] getCounts()
public void recomputePercentiles()
public byte[] toBytes()
public void dumpGnuPlot(PrintWriter out)
public void dump(PrintWriter out)
Copyright © 2015. All rights reserved.