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:
Michael Bayne
2006-11-03 00:15:46 +00:00
parent 515f2d6be5
commit d231214e59
@@ -70,6 +70,14 @@ public class Percentiler
* is added).
*/
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
// redistribute our buckets
@@ -80,10 +88,13 @@ public class Percentiler
int newmax = (int)Math.ceil(value*1.2);
float newdelta = (float)newmax / BUCKET_COUNT;
Log.info("Resizing [newmax=" + newmax + ", oldmax=" + _max + "].");
if (newmax > 2 * _max) {
Log.info("Holy christ! Big newmax [newmax=" + newmax +
if (logNewMax) {
Log.info("Resizing [newmax=" + newmax +
", 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