Better protection against divide-by-zero - if we have less than a second, we'll just round up to 1 second.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5938 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Mike Thomas
2009-09-04 22:42:27 +00:00
parent 3aec11f519
commit 2acedb91a4
@@ -111,7 +111,7 @@ public class ReportingInvoker extends Invoker
Stats stats = getStats(reset);
buf.append("- Max queue size: ").append(stats.maxQueueSize).append("\n");
buf.append("- Units executed: ").append(stats.unitsRun);
long runPerSec = (sinceLast == 0) ? 0 : stats.unitsRun/(sinceLast/1000);
long runPerSec = stats.unitsRun/Math.max(1, sinceLast/1000);
buf.append(" (").append(runPerSec).append("/s)\n");
if (_currentUnit != null) {
String uname = StringUtil.safeToString(_currentUnit);