After looking into IoSession and IoService, I ended up with the conclusion that we can use the same statistics type instead of providing different types for IoSession and IoService.
The following is the list of common methods in IoSession and IoService
(please note that getLargestXXX() methods are not present in IoSession
yet, but I think we can add it trivially.):
boolean isBothIdle();
boolean isIdle(IdleStatus status);
boolean isReaderIdle();
boolean isWriterIdle();
double getLargestReadBytesThroughput();
double getLargestReadMessagesThroughput();
double getLargestWrittenBytesThroughput();
double getLargestWrittenMessagesThroughput();
double getReadBytesThroughput();
double getReadMessagesThroughput();
double getWrittenBytesThroughput();
double getWrittenMessagesThroughput();
int getBothIdleCount();
int getIdleCount(IdleStatus status);
int getReaderIdleCount();
int getScheduledWriteBytes();
int getScheduledWriteMessages();
int getWriterIdleCount();
long getLastBothIdleTime();
long getLastIdleTime(IdleStatus status);
long getLastIoTime();
long getLastReaderIdleTime();
long getLastReadTime();
long getLastWriterIdleTime();
long getLastWriteTime();
long getReadBytes();
long getReadMessages();
long getWrittenBytes();
long getWrittenMessages();
Should we move all these methods to the statistics class or exclude
some? I think idleness properties are in the gray area. isXXXIdle()
sounds like a non-statistics property, but getXXXIdleCount() sounds like
a statistics property. And what about getLastXXXIdleTime?
Any lights?
Cheers,
Mark Webb wrote:
> +1. This would leave great potential for expansion (although I am not
> sure what other stats one would want :) )
>
> On Thu, Mar 20, 2008 at 12:54 AM, peter royal <[EMAIL PROTECTED]> wrote:
>> On Mar 19, 2008, at 3:23 PM, Frédéric Brégier wrote:
>>> Those numbers are useful in production... (at least for my case)
>>> I know, it's only about statistics but some people want them...
>>>
>>> If I follow your idea, what will return IoService.getStatistics() ?
>>> What will you propose instead of those methods in IoService?
>>> Also, those numbers are there, not elsewhere, so moving out
>>> of IoService, how could you do the same service ?
>>>
>>> I 'm not an expert as you on Mina, so I probably miss something there.
>> i was thinking of taking all the methods, and making:
>>
>> IoServiceStatistics getStatistics()
>>
>> .. they'll all still be available, just as methods on the statistics
>> object.
>>
>> -pete
>>
>>
>> --
>> [EMAIL PROTECTED] - http://fotap.org/~osi
>>
>>
>>
>>
>
>
>
--
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/
signature.asc
Description: OpenPGP digital signature
