Keep track of the total number of units run independently of Stats so it is not reset every 3 minutes by pulse.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5941 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2009-09-09 23:59:02 +00:00
parent 6f7c9831d8
commit 701d885222
@@ -82,6 +82,7 @@ public class ReportingInvoker extends Invoker
_current.maxQueueSize = queueSize;
}
_current.unitsRun++;
_totalUnitsRun++;
// note the currently invoking unit
_currentUnit = unit;
@@ -111,6 +112,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);
buf.append("- Total units executed: ").append(_totalUnitsRun);
long runPerSec = stats.unitsRun/Math.max(1, sinceLast/1000);
buf.append(" (").append(runPerSec).append("/s)\n");
if (_currentUnit != null) {
@@ -147,6 +149,9 @@ public class ReportingInvoker extends Invoker
/** Used to track runtime statistics. */
protected Stats _recent = new Stats(), _current = _recent;
/** The total number of units run. */
protected int _totalUnitsRun;
/** Records the currently invoking unit. */
protected Object _currentUnit;