I come back on this subject since I made my own solution;
not perfect but to let you known :

When all sessions are closed, I obtained the following
(using a simple HTTP service based on http codec) :
Active since: Wed Dec 12 17:23:57 CET 2007
Cumulative Sessions: 107
Maximum Concurrent Sessions: 106
Current Active Sessions: 0
Bytes read by Second: 0.0
Messages read by Second: 0.0
Cumulative Read Messages: 0
Bytes written by Second: 0.0
Messages written by Second: 0.0
Cumulative Written Messages: 109440

When they are still sessions active, I obtained the following :
Active since: Wed Dec 12 17:23:57 CET 2007
Cumulative Sessions: 106
Maximum Concurrent Sessions: 106
Current Active Sessions: 106
Bytes read by Second: 113200.9900990099
Messages read by Second: 0.0
Cumulative Read Messages: 0
Bytes written by Second: 5700083.168316832
Messages written by Second: 1079.8679867986798
Cumulative Written Messages: 51780

I don't know why Read Messages (max throughput or cumulative)
are still 0, but other values are OK.
I make my own count of Read Messages (just for testing),
and of course they were not 0 (of course since ReadBytes
is not 0 ;-)

So my solution to get those info but based even on closed sessions
is currently the following :
I create a Timer (scheduleAtFixedRate similar to the one used by 
setThroughputCalculationInterval) that just take the highest values
from the original one from Mina and store them.
The when I asked for statistics, I wrote the current value
(directly from IoAcceptor) and the max values I keep
(maximum throughput of Read/Written Bytes/Messages by second).

I think it is quite a good solution until now.
But perhaps Mina can add those statistics directly like :
getLargestReadBytesThrouhput (same for Written and Messages)
WDYT ?

Frederic

Reply via email to