Include current connection and handler count in our conmgr stats.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5539 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-11-11 18:47:58 +00:00
parent 2014f8c906
commit f4544ff76e
2 changed files with 11 additions and 0 deletions
@@ -29,6 +29,12 @@ import com.threerings.io.SimpleStreamableObject;
public class ConMgrStats extends SimpleStreamableObject
implements Cloneable
{
/** The number of mapped connections. This is a snapshot at the time the stats are requested. */
public int connectionCount;
/** The number of net event handlers. This is a snapshot at the time the stats are requested. */
public int handlerCount;
/** The size of the queue of waiting to auth sockets. This is a snapshot at the time the stats
* are requested. */
public int authQueueSize;
@@ -149,6 +149,8 @@ public class ConnectionManager extends LoopingThread
public synchronized ConMgrStats getStats ()
{
// fill in our snapshot values
_stats.connectionCount = _connections.size();
_stats.handlerCount = _handlers.size();
_stats.authQueueSize = _authq.size();
_stats.deathQueueSize = _deathq.size();
_stats.outQueueSize = _outq.size();
@@ -217,6 +219,9 @@ public class ConnectionManager extends LoopingThread
report.append("* presents.net.ConnectionManager:\n");
report.append("- Network connections: ");
report.append(stats.connectionCount).append(" connections, ");
report.append(stats.handlerCount).append(" handlers\n");
report.append("- Network activity: ");
report.append(eventCount).append(" events, ");
report.append(connects).append(" connects, ");
report.append(disconnects).append(" disconnects, ");