Added mostRecent() as that's the one we want to display rather than current
which is currently accumulating on the server and always zero on the client. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4224 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -58,14 +58,14 @@ public class ConMgrStats extends SimpleStreamableObject
|
|||||||
/** Creates our historical arrays. */
|
/** Creates our historical arrays. */
|
||||||
public void init ()
|
public void init ()
|
||||||
{
|
{
|
||||||
authQueueSize = new int[60];
|
authQueueSize = new int[SLOTS];
|
||||||
deathQueueSize = new int[60];
|
deathQueueSize = new int[SLOTS];
|
||||||
outQueueSize = new int[60];
|
outQueueSize = new int[SLOTS];
|
||||||
overQueueSize = new int[60];
|
overQueueSize = new int[SLOTS];
|
||||||
bytesIn = new int[60];
|
bytesIn = new int[SLOTS];
|
||||||
bytesOut = new int[60];
|
bytesOut = new int[SLOTS];
|
||||||
msgsIn = new int[60];
|
msgsIn = new int[SLOTS];
|
||||||
msgsOut = new int[60];
|
msgsOut = new int[SLOTS];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Advances the currently accumulating bucket and clears its
|
/** Advances the currently accumulating bucket and clears its
|
||||||
@@ -82,4 +82,14 @@ public class ConMgrStats extends SimpleStreamableObject
|
|||||||
msgsIn[current] = 0;
|
msgsIn[current] = 0;
|
||||||
msgsOut[current] = 0;
|
msgsOut[current] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the index of the most recently accumulated stats slot.
|
||||||
|
*/
|
||||||
|
public int mostRecent ()
|
||||||
|
{
|
||||||
|
return (current + SLOTS - 1) % SLOTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static final int SLOTS = 60;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user