Record our queue size once every five minutes, and do it using a nice

happy constant.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3595 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-06-13 18:42:29 +00:00
parent 457729fdcb
commit eec8a2ceb9
2 changed files with 11 additions and 6 deletions
@@ -238,16 +238,16 @@ public class PresentsDObjectMgr
_maxQueueSize = queueSize;
}
// report and reset our largest queue size once per minute
// report and reset our largest queue size once every 5 minutes
long startMillis = start * 1000 / freq;
if (_nextQueueReport < startMillis) {
if (_nextQueueReport != 0L) {
_statslog.log("max_dobj_queue_size " + _maxQueueSize);
_maxQueueSize = queueSize;
_nextQueueReport += 60 * 1000L;
_nextQueueReport += QUEUE_PROFILING_INTERVAL;
} else {
_nextQueueReport = startMillis + 60 * 1000L;
_nextQueueReport = startMillis + QUEUE_PROFILING_INTERVAL;
}
}
}
@@ -1016,6 +1016,9 @@ public class PresentsDObjectMgr
/** The default size of an oid list refs vector. */
protected static final int DEFREFVEC_SIZE = 4;
/** The frequency with which we report maximum queue size. */
protected static final long QUEUE_PROFILING_INTERVAL = 5 * 60 * 1000L;
/**
* This table maps event classes to helper methods that perform some
* additional processing for particular events.
@@ -98,15 +98,17 @@ public class PresentsInvoker extends Invoker
_maxQueueSize = queueSize;
}
// report and reset our largest queue size once per minute
// report and reset our largest queue size once every 5 minutes
if (_nextQueueReport < start) {
if (_nextQueueReport != 0L) {
_statslog.log("max_invoker_queue_size " + _maxQueueSize);
_maxQueueSize = queueSize;
_nextQueueReport += 60 * 1000L;
_nextQueueReport +=
PresentsDObjectMgr.QUEUE_PROFILING_INTERVAL;
} else {
_nextQueueReport = start + 60 * 1000L;
_nextQueueReport =
start + PresentsDObjectMgr.QUEUE_PROFILING_INTERVAL;
}
}
}