Great - just what I needed! On Fri, Nov 16, 2012 at 6:40 PM, Emmanuel Lécharny <elecha...@gmail.com>wrote:
> Le 11/16/12 10:54 AM, Dhruv Chopra a écrit : > > Hi, > > > > I need to get statistics from an IoSession such as the number of bytes > sent > > and received from it. And even the number of writes and messageReceived > > calls. Is there already a way of getting such information? If not, I am > > thinking of associating such stats as session attributes and once a > session > > closes - write these to my DB. Would that be the recommended way? > > You have many methods in the IoSession interface that let you get those > numbers : > > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getReadBytes() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getReadBytesThroughput() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getReadMessages() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getReadMessagesThroughput() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getWrittenBytes() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getWrittenBytesThroughput() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getWrittenMessages() > > http://mina.apache.org/mina/javadocs/org/apache/mina/core/session/IoSession.html#getWrittenMessagesThroughput() > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > >