mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Vermillard <jvermill...@archean.fr>
Subject Re: calculating throughput
Date Fri, 09 Jun 2006 07:40:20 GMT
Le vendredi 09 juin 2006 à 12:14 +0900, Trustin Lee a écrit :
> On 6/9/06, Julien Vermillard <jvermillard@archean.fr> wrote:
>         
>         Le mardi 30 mai 2006 à 11:09 +0900, Trustin Lee a écrit :
>         > On 5/29/06, daune.jf@daune-consult.com
>         <daune.jf@daune-consult.com> wrote:
>         > >
>         > > Quoting Julien Vermillard <jvermillard@archean.fr>:
>         > >
>         > > > Hi,
>         > > >
>         > > > I'm going to add thoughput calculation in my Session
>         MBean (written and 
>         > > > read bytes per seconds). I'm going to look at session
>         written and read
>         > > > byte every seconds. I'm wondering if it's the good place
>         for doing it,
>         > > > or a separate filter is a better idea ? 
>         > > >
>         > > > Julien
>         > > >
>         > > > BTW i found a thread on javagaming.org about Mina not
>         started by me ;)
>         > > > http://www.javagaming.org/forums/index.php?topic=13423.0
>         > >
>         > > A separate filter would allow easy insertion/removal of
>         this
>         > > performance 'probe'.
>         > >
>         > > I implemented such statistics at the IoHandler level, and
>         it is less 
>         > > flexible.
>         > >
>         > > I ran into the problem of defining 'work time' to compute
>         throughput
>         > > (server can be idle for a long time). I actually compute
>         time in the
>         > > 'messageReceived' and 'messageSent' of my IoHandler and
>         sum them up. 
>         > >
>         > > It is not ideal, because all time spent in Mina 'guts' is
>         not taken
>         > > into account. Maybe it would a good idea to compute this
>         time in Mina
>         > > itself.
>         > >
>         > > What do you think? 
>         >
>         >
>         > +1 here!  It also would be really nice if we can provide a
>         universal
>         > IoFilter that gathers all kinds performance statistics in an
>         extensible
>         > manner so we can add any performance counters related with
>         an IoSession very 
>         > easily.
>         >
>         > Trustin
>         
>         finaly I made a very simple implementation. I added it to the
>         Session
>         MBean. you start it calling the startAnalyze(int millisec)
>         methods, it
>         spawn a thread who calculate the throughtput every X
>         milli-seconds. 
>         
>         Look like that in jconsole.
>         http://issues.apache.org/jira/secure/attachment/12335216/12335216_jconsole.png
>         
>         At least it's fitting my little needs :)
> 
> This is awesome!  Nice job, Julien!
> 
> One thing I'd like to see is to make this analyzer a filter and
> provide a JMX interface that allows you to add or remove filters
> dynamically from the console.  Do you have any plan to do so? 
> 
> Cheers,
> Trustin
> 
Thank you, but it's only few code.

Well I don't see how I can calculate throughput on a event driven way
(on the msgSent & msgRcv IoHandler methods). Actualy it's every n
seconds I look at the sent/rcved bytes and calculate the byte per
seconds throughput. I can still make an Iohandler which is spawing a
timer thread for make throughput calculations,  but it's not much more
interesting than doing it in the MBean (except perhaps for people who
don't want to use JMX).

Any idea is welcome :)

Julien

Mime
View raw message