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 );
     collector.start();
     
    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 https://svn.apache.org/repos/asf/mina/branches/1.1/core/src/main/java/org/apache/mina/management.

    Author:
    The Apache Directory Project (mina-dev@directory.apache.org)
    • 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.
        Parameters:
        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
        Parameters:
        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
        Returns:
        true if started
      • getTotalProcessedSessions

        public long getTotalProcessedSessions()
        total number of sessions processed by the stat collector
        Returns:
        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()