org.apache.mina.core.service

## Class IoServiceStatistics

- java.lang.Object
- - org.apache.mina.core.service.IoServiceStatistics

-     public class IoServiceStatistics
      extends Object

  Provides usage statistics for an `AbstractIoService` instance.
  Since:
    2.0.0-M3
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IoServiceStatistics(AbstractIoService service)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `decreaseScheduledWriteMessages()` Decrements by 1 the count of messages scheduled for write.
    `long` | `getCumulativeManagedSessionCount()` Returns the cumulative number of sessions which were managed (or are being managed) by this service, which means 'currently managed session count + closed session count'.
    `int` | `getLargestManagedSessionCount()` Returns the maximum number of sessions which were being managed at the same time.
    `double` | `getLargestReadBytesThroughput()` Returns the maximum of the `readBytesThroughput`.
    `double` | `getLargestReadMessagesThroughput()` Returns the maximum of the `readMessagesThroughput`.
    `double` | `getLargestWrittenBytesThroughput()` Returns the maximum of the `writtenBytesThroughput`.
    `double` | `getLargestWrittenMessagesThroughput()` Returns the maximum of the `writtenMessagesThroughput`.
    `long` | `getLastIoTime()` Returns the time in millis when I/O occurred lastly.
    `long` | `getLastReadTime()` Returns the time in millis when read operation occurred lastly.
    `long` | `getLastWriteTime()` Returns the time in millis when write operation occurred lastly.
    `long` | `getReadBytes()` Returns the number of bytes read by this service
    `double` | `getReadBytesThroughput()` Returns the number of read bytes per second.
    `long` | `getReadMessages()` Returns the number of messages this services has read
    `double` | `getReadMessagesThroughput()` Returns the number of read messages per second.
    `int` | `getScheduledWriteBytes()` Returns the count of bytes scheduled for write.
    `int` | `getScheduledWriteMessages()` Returns the count of messages scheduled for write.
    `int` | `getThroughputCalculationInterval()` Returns the interval (seconds) between each throughput calculation.
    `long` | `getThroughputCalculationIntervalInMillis()` Returns the interval (milliseconds) between each throughput calculation.
    `long` | `getWrittenBytes()` Returns the number of bytes written out by this service
    `double` | `getWrittenBytesThroughput()` Returns the number of written bytes per second.
    `long` | `getWrittenMessages()` Returns the number of messages this service has written
    `double` | `getWrittenMessagesThroughput()` Returns the number of written messages per second.
    `void` | `increaseReadBytes(long increment, long currentTime)` Increases the count of read bytes by `increment` and sets the last read time to `currentTime`.
    `void` | `increaseReadMessages(long currentTime)` Increases the count of read messages by 1 and sets the last read time to `currentTime`.
    `void` | `increaseScheduledWriteBytes(int increment)` Increments by `increment` the count of bytes scheduled for write.
    `void` | `increaseScheduledWriteMessages()` Increments by 1 the count of messages scheduled for write.
    `void` | `increaseWrittenBytes(int increment, long currentTime)` Increases the count of written bytes by `increment` and sets the last write time to `currentTime`.
    `void` | `increaseWrittenMessages(long currentTime)` Increases the count of written messages by 1 and sets the last write time to `currentTime`.
    `protected void` | `setLastReadTime(long lastReadTime)` Sets last time at which a read occurred on the service.
    `protected void` | `setLastThroughputCalculationTime(long lastThroughputCalculationTime)` Sets the time at which throughtput counters where updated.
    `protected void` | `setLastWriteTime(long lastWriteTime)` Sets last time at which a write occurred on the service.
    `void` | `setThroughputCalculationInterval(int throughputCalculationInterval)` Sets the interval (seconds) between each throughput calculation.
    `void` | `updateThroughput(long currentTime)` Updates the throughput counters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IoServiceStatistics

          public IoServiceStatistics(AbstractIoService service)

  - ### Method Detail

    - #### getLargestManagedSessionCount

          public final int getLargestManagedSessionCount()

      Returns the maximum number of sessions which were being managed at the same time.

    - #### getCumulativeManagedSessionCount

          public final long getCumulativeManagedSessionCount()

      Returns the cumulative number of sessions which were managed (or are being managed) by this service, which means 'currently managed session count + closed session count'.

    - #### getLastIoTime

          public final long getLastIoTime()

      Returns the time in millis when I/O occurred lastly.

    - #### getLastReadTime

          public final long getLastReadTime()

      Returns the time in millis when read operation occurred lastly.

    - #### getLastWriteTime

          public final long getLastWriteTime()

      Returns the time in millis when write operation occurred lastly.

    - #### getReadBytes

          public final long getReadBytes()

      Returns the number of bytes read by this service
      Returns:
        The number of bytes this service has read

    - #### getWrittenBytes

          public final long getWrittenBytes()

      Returns the number of bytes written out by this service
      Returns:
        The number of bytes this service has written

    - #### getReadMessages

          public final long getReadMessages()

      Returns the number of messages this services has read
      Returns:
        The number of messages this services has read

    - #### getWrittenMessages

          public final long getWrittenMessages()

      Returns the number of messages this service has written
      Returns:
        The number of messages this service has written

    - #### getReadBytesThroughput

          public final double getReadBytesThroughput()

      Returns the number of read bytes per second.

    - #### getWrittenBytesThroughput

          public final double getWrittenBytesThroughput()

      Returns the number of written bytes per second.

    - #### getReadMessagesThroughput

          public final double getReadMessagesThroughput()

      Returns the number of read messages per second.

    - #### getWrittenMessagesThroughput

          public final double getWrittenMessagesThroughput()

      Returns the number of written messages per second.

    - #### getLargestReadBytesThroughput

          public final double getLargestReadBytesThroughput()

      Returns the maximum of the `readBytesThroughput`.

    - #### getLargestWrittenBytesThroughput

          public final double getLargestWrittenBytesThroughput()

      Returns the maximum of the `writtenBytesThroughput`.

    - #### getLargestReadMessagesThroughput

          public final double getLargestReadMessagesThroughput()

      Returns the maximum of the `readMessagesThroughput`.

    - #### getLargestWrittenMessagesThroughput

          public final double getLargestWrittenMessagesThroughput()

      Returns the maximum of the `writtenMessagesThroughput`.

    - #### getThroughputCalculationInterval

          public final int getThroughputCalculationInterval()

      Returns the interval (seconds) between each throughput calculation. The default value is `3` seconds.

    - #### getThroughputCalculationIntervalInMillis

          public final long getThroughputCalculationIntervalInMillis()

      Returns the interval (milliseconds) between each throughput calculation. The default value is `3` seconds.

    - #### setThroughputCalculationInterval

          public final void setThroughputCalculationInterval(int throughputCalculationInterval)

      Sets the interval (seconds) between each throughput calculation. The default value is `3` seconds.

    - #### setLastReadTime

          protected final void setLastReadTime(long lastReadTime)

      Sets last time at which a read occurred on the service.

    - #### setLastWriteTime

          protected final void setLastWriteTime(long lastWriteTime)

      Sets last time at which a write occurred on the service.

    - #### updateThroughput

          public void updateThroughput(long currentTime)

      Updates the throughput counters.

    - #### increaseReadBytes

          public final void increaseReadBytes(long increment,
                               long currentTime)

      Increases the count of read bytes by `increment` and sets the last read time to `currentTime`.

    - #### increaseReadMessages

          public final void increaseReadMessages(long currentTime)

      Increases the count of read messages by 1 and sets the last read time to `currentTime`.

    - #### increaseWrittenBytes

          public final void increaseWrittenBytes(int increment,
                                  long currentTime)

      Increases the count of written bytes by `increment` and sets the last write time to `currentTime`.

    - #### increaseWrittenMessages

          public final void increaseWrittenMessages(long currentTime)

      Increases the count of written messages by 1 and sets the last write time to `currentTime`.

    - #### getScheduledWriteBytes

          public final int getScheduledWriteBytes()

      Returns the count of bytes scheduled for write.

    - #### increaseScheduledWriteBytes

          public final void increaseScheduledWriteBytes(int increment)

      Increments by `increment` the count of bytes scheduled for write.

    - #### getScheduledWriteMessages

          public final int getScheduledWriteMessages()

      Returns the count of messages scheduled for write.

    - #### increaseScheduledWriteMessages

          public final void increaseScheduledWriteMessages()

      Increments by 1 the count of messages scheduled for write.

    - #### decreaseScheduledWriteMessages

          public final void decreaseScheduledWriteMessages()

      Decrements by 1 the count of messages scheduled for write.

    - #### setLastThroughputCalculationTime

          protected void setLastThroughputCalculationTime(long lastThroughputCalculationTime)

      Sets the time at which throughtput counters where updated.

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.