Make the logging optional.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@119 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -70,6 +70,14 @@ public class Percentiler
|
|||||||
* is added).
|
* is added).
|
||||||
*/
|
*/
|
||||||
public void recordValue (float value)
|
public void recordValue (float value)
|
||||||
|
{
|
||||||
|
recordValue(value, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See {@link #recordValue(float)}.
|
||||||
|
*/
|
||||||
|
public void recordValue (float value, boolean logNewMax)
|
||||||
{
|
{
|
||||||
// if this value is larger than our maximum value, we need to
|
// if this value is larger than our maximum value, we need to
|
||||||
// redistribute our buckets
|
// redistribute our buckets
|
||||||
@@ -80,10 +88,13 @@ public class Percentiler
|
|||||||
int newmax = (int)Math.ceil(value*1.2);
|
int newmax = (int)Math.ceil(value*1.2);
|
||||||
float newdelta = (float)newmax / BUCKET_COUNT;
|
float newdelta = (float)newmax / BUCKET_COUNT;
|
||||||
|
|
||||||
Log.info("Resizing [newmax=" + newmax + ", oldmax=" + _max + "].");
|
if (logNewMax) {
|
||||||
if (newmax > 2 * _max) {
|
Log.info("Resizing [newmax=" + newmax +
|
||||||
Log.info("Holy christ! Big newmax [newmax=" + newmax +
|
|
||||||
", oldmax=" + _max + "].");
|
", oldmax=" + _max + "].");
|
||||||
|
if (newmax > 2 * _max) {
|
||||||
|
Log.info("Holy christ! Big newmax [value=" + value +
|
||||||
|
", oldmax=" + _max + "].");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new counts array and map the old array to the new
|
// create a new counts array and map the old array to the new
|
||||||
|
|||||||
Reference in New Issue
Block a user