I would like, as a user (so it is not of course mandatory at all ;-)
to have a way to get those values without using JMX.

OK, it would probably be better to use JMX for external services
which want to know about those tasks, but one could want
(not me at that time, but I don't know in the future)
to get those numbers in the Mina layout so as to
have some action on current connections.

Let say for instance, above a given numbers of bytes, one
session needs to be closed by the server outside any protocol
control (deny of service for instance). It's just an example,
so don't push it too far... I was just thinking of the utility
of such numbers inside Mina layout instead of outside
(outside means for me from JMX).

Adding to that point, I must admit that I don't know enough about
JMX (a good lesson to learn in the next weeks I think).
But adding this layout to just get numbers when I get them
easily before through IoSession and IoService (both of them)
seems to me a bit complicated...

As this looks like only as a cosmetic approach using
one class for IoService (and another one for IoSession,
perhaps the same even ?), and as noted Alex using
always the same object for IoService (and for one
specific session the same object during the life of this
IoSession) for performance reason (and also implementation
reason), it seems fine to me.

Again, that's just a point of vue of an end user...

Frederic
----- Original Message ----- 
From: "Alex Karasulu"

On Thu, Mar 20, 2008 at 9:48 AM, Emmanuel Lecharny wrote:

> Julien Vermillard wrote:
> > On Wed, 19 Mar 2008 23:53:03 +0100
> > Emmanuel Lecharny wrote:
> >
> >
> >> 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() ?
> >>>
> >>>
> >> I guess that Peter meant something like : getStatistics(
> >> IoSession.GET_MANAGED_SESSION_COUNT ), etc.
> >>
> >> Then you have your stats, _and_ you don't clutter the API with dozens
> >> of additional methods.
> >>
> >> Otherwise, what about using JMX for such stats ?
> >>
> >>
> >
> > Hi,
> >
> > heh I don't think JMX should be mandatory for having access to stats.
> > And you talk about bloat ? ;)
> >
> Well, JMX is pretty transversal... We can't say it's a bloat :)
>
> Anyway, it was just a proposal :)
>

JMX is just a way to access this information which still needs to be stored
somewhere in some statistics object.  JMX won't instantly give us the
statistics variables.

I like Peter's idea of having a statistics object to contain
instance/accumulated stats.  BTW I don't think we need to create this object
everytime the stats are queried.  The object can be created once and
reused.  Hence getStatistics() will always return the same object instance,
and MINA will just update values in it.

Alex

Reply via email to