Class MINAStatCollector

  • public class MINAStatCollector
    extends Object
    Collects statistics of an IoService. It's polling all the sessions of a given IoService. It's attaching a MINAStatCollector.IoSessionStat object to all the sessions polled and filling the throughput values. Usage :
     IoService service = ...
     MINAStatCollector collector = new MINAStatCollector( service );
    By default the MINAStatCollector is polling the sessions every 5 seconds. You can give a different polling time using a second constructor.

    Note: This class is a spin-off from StatCollector present in

    The Apache Directory Project (
    • Constructor Detail

      • MINAStatCollector

        public MINAStatCollector​(org.apache.mina.core.service.IoService service)
        Create a stat collector for the given service with a default polling time of 5 seconds.
        service - the IoService to inspect
      • MINAStatCollector

        public MINAStatCollector​(org.apache.mina.core.service.IoService service,
                                 int pollingInterval)
        create a stat collector for the given given service
        service - the IoService to inspect
        pollingInterval - milliseconds
    • Method Detail

      • start

        public void start()
        Start collecting stats for the IoSession of the service. New sessions or destroyed will be automaticly added or removed.
      • isRunning

        public boolean isRunning()
        is the stat collector started and polling the IoSession of the IoService
        true if started
      • getTotalProcessedSessions

        public long getTotalProcessedSessions()
        total number of sessions processed by the stat collector
        number of sessions
      • getBytesRead

        public long getBytesRead()
      • getBytesWritten

        public long getBytesWritten()
      • getMsgRead

        public long getMsgRead()
      • getMsgWritten

        public long getMsgWritten()
      • getScheduledWrites

        public long getScheduledWrites()
      • getQueuedEvents

        public long getQueuedEvents()
      • getSessionCount

        public long getSessionCount()