From d231214e59f55f1083076b30515516a131b5ac3a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 3 Nov 2006 00:15:46 +0000 Subject: [PATCH] Make the logging optional. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@119 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../parlor/rating/util/Percentiler.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/java/com/threerings/parlor/rating/util/Percentiler.java b/src/java/com/threerings/parlor/rating/util/Percentiler.java index b162b032..8806c80b 100644 --- a/src/java/com/threerings/parlor/rating/util/Percentiler.java +++ b/src/java/com/threerings/parlor/rating/util/Percentiler.java @@ -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